Handle ConfigParser -> configparser rename
authorGuido Günther <agx@sigxcpu.org>
Thu, 19 Feb 2015 11:30:54 +0000 (12:30 +0100)
committerGuido Günther <agx@sigxcpu.org>
Fri, 20 Feb 2015 11:40:14 +0000 (12:40 +0100)
to work towards Python3 support

Gbp-Dch: Ignore

13 files changed:
examples/gbp-posttag-push
gbp/config.py
gbp/scripts/buildpackage.py
gbp/scripts/clone.py
gbp/scripts/config.py
gbp/scripts/create_remote_repo.py
gbp/scripts/dch.py
gbp/scripts/import_dsc.py
gbp/scripts/import_orig.py
gbp/scripts/import_srpm.py
gbp/scripts/pq.py
gbp/scripts/pq_rpm.py
gbp/scripts/pull.py

index 76235ad62b44119e1d1b9d8813231259d52305f1..cabffffae45efa377aed4775789adcab4b1d3f77 100755 (executable)
@@ -20,7 +20,7 @@
 # --verbose: verbose command output
 
 
-import ConfigParser
+from six.moves import configparser
 import os
 import subprocess
 import sys
@@ -83,7 +83,7 @@ def main(argv):
     try:
         parser = GbpOptionParser(command=os.path.basename(argv[0]), prefix='',
                                  usage='%prog [options] paths')
-    except ConfigParser.ParsingError as err:
+    except configparser.ParsingError as err:
         gbp.log.error(err)
         return 1
 
index e724853bd9c1b67a527f2b4b7a42d94563458ae5..cc46cf7be38f4ce3eb68a47f608343aaa46b9e15 100644 (file)
@@ -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
 
index 1c48c054320e2606d19711623d1f3f0480530c31..0eff51502c5c7ca64b20dd79a342e6f16a238704 100755 (executable)
@@ -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
 
index 4593bc6d19ed119604726aede30e950c4ace1716..5232de9bf0c8431ca94481b39b30404c2c1de494 100755 (executable)
@@ -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
 
index 07c731c0ccfe76f6f11b36c2cd8cab43051bbdb5..cb5d82dc5f7b820dd11f98b3957616835072b76d 100755 (executable)
 #
 """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
 
index fd74dcaad8c0fe3b13331beb5f0399cb80344cf1..821f0600f347fac91eab636a6a709eda22eab6b2 100644 (file)
@@ -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
 
index b6c77b1a65727019aba766ab46bffc52d9ad797f..2df4b2d256a12e416f6da9c2332cc5d20669659e 100644 (file)
@@ -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
 
index f4dac9c012fc24afa403673d3bc122a2ffd4dea4..4c5747e7ff1e06a3360fa5591b7ff05150f3a144 100644 (file)
@@ -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
 
index 1e0e85b205539d86e7f526bc25dfb0f500c1b9c9..3840053d3437b350bf254d3663f3ef22cfd5fbb0 100644 (file)
@@ -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
 
index 7ca87aa39980a99987f38689c779c132e95b6843..a976f2ad031d1c4e5c5d76745cb7b26f4fc30dab 100755 (executable)
@@ -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
 
index cf76c35d4c94300391b2957e54a79c498e8f3311..1e1e96bf66306a0c774b9515a700ab16804a13e6 100755 (executable)
@@ -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
 
index ab50cad670658b4aff86ede9a82d82fe83c0a282..764ccff2677a10548a78bbb494b722de0a698ce3 100755 (executable)
@@ -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
 
index 65e3e4922cc2cf5e48b822abc415228dfcc2891a..d09119836a5bcccb53cf02c6a1defa774ff7edbd 100755 (executable)
@@ -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