From 4766e1190a7ccb4c5a8f21ce3e8919637ff9c142 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Thu, 19 Feb 2015 12:30:54 +0100 Subject: Handle ConfigParser -> configparser rename to work towards Python3 support Gbp-Dch: Ignore --- gbp/config.py | 2 +- gbp/scripts/buildpackage.py | 4 ++-- gbp/scripts/clone.py | 4 ++-- gbp/scripts/config.py | 7 +++---- gbp/scripts/create_remote_repo.py | 4 ++-- gbp/scripts/dch.py | 4 ++-- gbp/scripts/import_dsc.py | 4 ++-- gbp/scripts/import_orig.py | 4 ++-- gbp/scripts/import_srpm.py | 4 ++-- gbp/scripts/pq.py | 4 ++-- gbp/scripts/pq_rpm.py | 4 ++-- gbp/scripts/pull.py | 4 ++-- 12 files changed, 24 insertions(+), 25 deletions(-) (limited to 'gbp') diff --git a/gbp/config.py b/gbp/config.py index e724853..cc46cf7 100644 --- a/gbp/config.py +++ b/gbp/config.py @@ -17,7 +17,7 @@ """handles command line and config file option parsing for the gbp commands""" from optparse import OptionParser, OptionGroup, Option, OptionValueError -from ConfigParser import SafeConfigParser, NoSectionError +from six.moves.configparser import SafeConfigParser, NoSectionError from copy import copy import os.path diff --git a/gbp/scripts/buildpackage.py b/gbp/scripts/buildpackage.py index 1c48c05..0eff515 100755 --- a/gbp/scripts/buildpackage.py +++ b/gbp/scripts/buildpackage.py @@ -17,7 +17,7 @@ # """Build a Debian package out of a Git repository""" -import ConfigParser +from six.moves import configparser import errno import os, os.path import sys @@ -372,7 +372,7 @@ def changes_file_suffix(dpkg_args): def build_parser(name, prefix=None): try: parser = GbpOptionParserDebian(command=os.path.basename(name), prefix=prefix) - except ConfigParser.ParsingError as err: + except configparser.ParsingError as err: gbp.log.err(err) return None diff --git a/gbp/scripts/clone.py b/gbp/scripts/clone.py index 4593bc6..5232de9 100755 --- a/gbp/scripts/clone.py +++ b/gbp/scripts/clone.py @@ -19,7 +19,7 @@ # """Clone a Git repository and set it up for gbp""" -import ConfigParser +from six.moves import configparser import sys import os, os.path from gbp.config import (GbpOptionParser, GbpOptionGroup) @@ -33,7 +33,7 @@ def build_parser(name): try: parser = GbpOptionParser(command=os.path.basename(name), prefix='', usage='%prog [options] repository - clone a remote repository') - except ConfigParser.ParsingError as err: + except configparser.ParsingError as err: gbp.log.err(err) return None diff --git a/gbp/scripts/config.py b/gbp/scripts/config.py index 07c731c..cb5d82d 100755 --- a/gbp/scripts/config.py +++ b/gbp/scripts/config.py @@ -17,11 +17,10 @@ # """Query and display config file values""" -import ConfigParser +from six.moves import configparser import sys import os, os.path -from gbp.config import (GbpOptionParser, GbpOptionGroup) -from gbp.errors import GbpError +from gbp.config import GbpOptionParser from gbp.scripts.supercommand import import_command import gbp.log @@ -30,7 +29,7 @@ def build_parser(name): try: parser = GbpOptionParser(command=os.path.basename(name), prefix='', usage='%prog [options] command[.optionname] - display configuration settings') - except ConfigParser.ParsingError as err: + except configparser.ParsingError as err: gbp.log.err(err) return None diff --git a/gbp/scripts/create_remote_repo.py b/gbp/scripts/create_remote_repo.py index fd74dca..821f060 100644 --- a/gbp/scripts/create_remote_repo.py +++ b/gbp/scripts/create_remote_repo.py @@ -20,7 +20,7 @@ from __future__ import print_function -import ConfigParser +from six.moves import configparser import sys import os, os.path import urlparse @@ -234,7 +234,7 @@ def build_parser(name, sections=[]): usage='%prog [options] - ' 'create a remote repository', sections=sections) - except ConfigParser.ParsingError as err: + except configparser.ParsingError as err: gbp.log.err(err) return None diff --git a/gbp/scripts/dch.py b/gbp/scripts/dch.py index b6c77b1..2df4b2d 100644 --- a/gbp/scripts/dch.py +++ b/gbp/scripts/dch.py @@ -19,7 +19,7 @@ from __future__ import print_function -import ConfigParser +from six.moves import configparser import os.path import re import sys @@ -297,7 +297,7 @@ def build_parser(name): try: parser = GbpOptionParserDebian(command=os.path.basename(name), usage='%prog [options] paths') - except ConfigParser.ParsingError as err: + except configparser.ParsingError as err: gbp.log.err(err) return None diff --git a/gbp/scripts/import_dsc.py b/gbp/scripts/import_dsc.py index f4dac9c..4c5747e 100644 --- a/gbp/scripts/import_dsc.py +++ b/gbp/scripts/import_dsc.py @@ -16,7 +16,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA """Import a Debian source package into a Git repository""" -import ConfigParser +from six.moves import configparser import sys import re import os @@ -208,7 +208,7 @@ def build_parser(name): try: parser = GbpOptionParserDebian(command=os.path.basename(name), prefix='', usage='%prog [options] /path/to/package.dsc') - except ConfigParser.ParsingError as err: + except configparser.ParsingError as err: gbp.log.err(err) return None diff --git a/gbp/scripts/import_orig.py b/gbp/scripts/import_orig.py index 1e0e85b..3840053 100644 --- a/gbp/scripts/import_orig.py +++ b/gbp/scripts/import_orig.py @@ -17,7 +17,7 @@ # """Import a new upstream version into a Git repository""" -import ConfigParser +from six.moves import configparser import os import sys import tempfile @@ -187,7 +187,7 @@ def build_parser(name): try: parser = GbpOptionParserDebian(command=os.path.basename(name), prefix='', usage='%prog [options] /path/to/upstream-version.tar.gz | --uscan') - except ConfigParser.ParsingError as err: + except configparser.ParsingError as err: gbp.log.err(err) return None diff --git a/gbp/scripts/import_srpm.py b/gbp/scripts/import_srpm.py index 7ca87aa..a976f2a 100755 --- a/gbp/scripts/import_srpm.py +++ b/gbp/scripts/import_srpm.py @@ -17,7 +17,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA """Import an RPM source package into a Git repository""" -import ConfigParser +from six.moves import configparser import sys import re import os @@ -122,7 +122,7 @@ def build_parser(name): prefix='', usage='%prog [options] /path/to/package' '.src.rpm') - except ConfigParser.ParsingError as err: + except configparser.ParsingError as err: gbp.log.err(err) return None diff --git a/gbp/scripts/pq.py b/gbp/scripts/pq.py index cf76c35..1e1e96b 100755 --- a/gbp/scripts/pq.py +++ b/gbp/scripts/pq.py @@ -17,7 +17,7 @@ # """Manage Debian patches on a patch queue branch""" -import ConfigParser +from six.moves import configparser import errno import os import shutil @@ -328,7 +328,7 @@ def build_parser(name): " drop drop (delete) the patch queue associated to the current branch.\n" " apply apply a patch\n" " switch switch to patch-queue branch and vice versa") - except ConfigParser.ParsingError as err: + except configparser.ParsingError as err: gbp.log.err(err) return None diff --git a/gbp/scripts/pq_rpm.py b/gbp/scripts/pq_rpm.py index ab50cad..764ccff 100755 --- a/gbp/scripts/pq_rpm.py +++ b/gbp/scripts/pq_rpm.py @@ -18,7 +18,7 @@ # """manage patches in a patch queue""" -import ConfigParser +from six.moves import configparser import bz2 import errno import gzip @@ -363,7 +363,7 @@ drop Drop (delete) the patch queue /devel branch associated to apply Apply a patch switch Switch to patch-queue branch and vice versa.""") - except ConfigParser.ParsingError as err: + except configparser.ParsingError as err: gbp.log.err('Invalid config file: %s' % err) return None diff --git a/gbp/scripts/pull.py b/gbp/scripts/pull.py index 65e3e49..d091198 100755 --- a/gbp/scripts/pull.py +++ b/gbp/scripts/pull.py @@ -19,7 +19,7 @@ # """Pull remote changes and fast forward debian, upstream and pristine-tar branch""" -import ConfigParser +from six.moves import configparser import sys import os, os.path from gbp.command_wrappers import (Command, CommandExecFailed) @@ -73,7 +73,7 @@ def build_parser(name): try: parser = GbpOptionParser(command=os.path.basename(name), prefix='', usage='%prog [options] - safely update a repository from remote') - except ConfigParser.ParsingError as err: + except configparser.ParsingError as err: gbp.log.err(err) return None -- cgit v1.2.3