소스 검색

Fixing configparser import for Python 3.

Dan Helfman 10 년 전
부모
커밋
273ca83f6b
1개의 변경된 파일7개의 추가작업 그리고 1개의 파일을 삭제
  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'