diff options
author | olly <olly@ollycope.com> | 2013-12-09 12:16:25 +0100 |
---|---|---|
committer | olly <olly@ollycope.com> | 2013-12-09 12:16:25 +0100 |
commit | ac4fa8144e67e0527f31178d34fdfc874ac4e661 (patch) | |
tree | 102bb375cf19b4db5b800642e65a35116a3aa64f | |
parent | 3823a98ad50098e5ee41f7ff9517326756afb451 (diff) | |
download | yoyo-ac4fa8144e67e0527f31178d34fdfc874ac4e661.tar.gz |
Fixed configparser imports for py3 compat
-rw-r--r-- | yoyo/scripts/migrate.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/yoyo/scripts/migrate.py b/yoyo/scripts/migrate.py index 4fa7a8e..ae53a59 100644 --- a/yoyo/scripts/migrate.py +++ b/yoyo/scripts/migrate.py @@ -5,9 +5,11 @@ import optparse import os import re import sys -import ConfigParser +try: + from configparser import ConfigParser, NoSectionError, NoOptionError +except ImportError: + from ConfigParser import ConfigParser, NoSectionError, NoOptionError # noqa -from ConfigParser import NoSectionError, NoOptionError from getpass import getpass from yoyo.connections import connect, parse_uri, unparse_uri @@ -24,7 +26,7 @@ verbosity_levels = { def readconfig(path): - config = ConfigParser.ConfigParser() + config = ConfigParser() config.read([path]) return config |