]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
ConfigParser renamed to configparser since Python 3
authorHong Minhee <minhee@dahlia.kr>
Fri, 12 Apr 2013 19:33:15 +0000 (04:33 +0900)
committerHong Minhee <minhee@dahlia.kr>
Fri, 12 Apr 2013 19:33:15 +0000 (04:33 +0900)
alembic/config.py
tests/__init__.py

index bd56e5099d84aa70ae51b945902422c1cee68b42..e6b09d2e57cb991ad700adfa26729f5f7032cac1 100644 (file)
@@ -1,5 +1,8 @@
 from argparse import ArgumentParser
-import ConfigParser
+try:
+    import configparser
+except ImportError:
+    import ConfigParser as configparser
 import inspect
 import os
 import sys
@@ -91,7 +94,7 @@ class Config(object):
             here = os.path.abspath(os.path.dirname(self.config_file_name))
         else:
             here = ""
-        file_config = ConfigParser.SafeConfigParser({'here': here})
+        file_config = configparser.SafeConfigParser({'here': here})
         if self.config_file_name:
             file_config.read([self.config_file_name])
         else:
index 97737fdc2bc1eb68bccc58dce95693336648718e..f7bcdcdd1df5a3cf8146fc3204b6e9655f80fb57 100644 (file)
@@ -32,7 +32,7 @@ from alembic.ddl.impl import _impls
 staging_directory = os.path.join(os.path.dirname(__file__), 'scratch')
 files_directory = os.path.join(os.path.dirname(__file__), 'files')
 
-testing_config = ConfigParser.ConfigParser()
+testing_config = configparser.ConfigParser()
 testing_config.read(['test.cfg'])
 
 def sqlite_db():
@@ -56,7 +56,7 @@ def db_for_dialect(name):
     else:
         try:
             cfg = testing_config.get("db", name)
-        except ConfigParser.NoOptionError:
+        except configparser.NoOptionError:
             raise SkipTest("No dialect %r in test.cfg" % name)
         try:
             eng = create_engine(cfg)