From: Torsten Werner Date: Wed, 24 Aug 2011 18:38:25 +0000 (+0200) Subject: Replace deprecated sys.exc_type and sys.exc_value. X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f9e12bd3887917d6af572282d3c961686cd7251;p=dak Replace deprecated sys.exc_type and sys.exc_value. This is deprecated since Python 1.5! Signed-off-by: Torsten Werner --- diff --git a/dak/clean_queues.py b/dak/clean_queues.py index 4147ab05..e6e4f76c 100755 --- a/dak/clean_queues.py +++ b/dak/clean_queues.py @@ -157,7 +157,7 @@ def flush_orphans (): changes = utils.parse_changes(changes_filename) files = utils.build_file_list(changes) except: - utils.warn("error processing '%s'; skipping it. [Got %s]" % (changes_filename, sys.exc_type)) + utils.warn("error processing '%s'; skipping it. [Got %s]" % (changes_filename, sys.exc_info()[0])) continue dsc_files = {} @@ -167,7 +167,7 @@ def flush_orphans (): dsc = utils.parse_changes(f, dsc_file=1) dsc_files = utils.build_file_list(dsc, is_a_dsc=1) except: - utils.warn("error processing '%s'; skipping it. [Got %s]" % (f, sys.exc_type)) + utils.warn("error processing '%s'; skipping it. [Got %s]" % (f, sys.exc_info()[0])) continue # Ensure all the files we've seen aren't deleted diff --git a/daklib/queue.py b/daklib/queue.py index fa4a95f4..f6593394 100755 --- a/daklib/queue.py +++ b/daklib/queue.py @@ -714,7 +714,7 @@ class Upload(object): try: control = apt_pkg.ParseSection(apt_inst.debExtractControl(deb_file)) except: - self.rejects.append("%s: debExtractControl() raised %s." % (f, sys.exc_type)) + self.rejects.append("%s: debExtractControl() raised %s." % (f, sys.exc_info()[0])) deb_file.close() # Can't continue, none of the checks on control would work. return @@ -1654,7 +1654,7 @@ class Upload(object): self.rejects.append("%s: has %s file(s) with a time stamp too ancient (e.g. %s [%s])." % (filename, num_ancient_files, ancient_file, time.ctime(ancient_date))) except: - self.rejects.append("%s: deb contents timestamp check failed [%s: %s]" % (filename, sys.exc_type, sys.exc_value)) + self.rejects.append("%s: deb contents timestamp check failed [%s: %s]" % (filename, sys.exc_info()[0], sys.exc_info()[1])) def check_if_upload_is_sponsored(self, uid_email, uid_name): uid_email = '@'.join(uid_email.split('@')[:2])