Explorar o código

Fixing configparser import for Python 3.

Dan Helfman %!s(int64=10) %!d(string=hai) anos
pai
achega
273ca83f6b
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  1. 7 1
      atticmatic/config.py

+ 7 - 1
atticmatic/config.py

@@ -1,5 +1,11 @@
 from collections import namedtuple
-from ConfigParser import ConfigParser
+
+try:
+    # Python 2
+    from ConfigParser import ConfigParser
+except ImportError:
+    # Python 3
+    from configparser import ConfigParser
 
 
 CONFIG_SECTION_LOCATION = 'location'