Skip to content

Commit 9d91a44

Browse files
committed
Merge pull request #17 from ktdreyer/conf-exception
conf.py: py2/py3 compatible exception handling
2 parents 4b18dc0 + 9b50dea commit 9d91a44

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

kobo/conf.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import fnmatch
2828
import itertools
2929
import keyword
30+
import sys
3031
import token
3132
import tokenize
3233
from cStringIO import StringIO
@@ -334,5 +335,6 @@ def _get_tuple(self):
334335
try:
335336
settings = PyConfigParser()
336337
settings.load_from_file(os.environ.get("PROJECT_CONFIG_FILE"))
337-
except Exception, ex:
338+
except Exception:
339+
ex = sys.exc_info()[1]
338340
raise ImproperlyConfigured("Could not load config file: %s" % ex)

0 commit comments

Comments
 (0)