From bf68a9592db4c90bc9421ce49c7c0766966d6e7e Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sat, 18 May 2013 00:18:18 +0200 Subject: Improve Python 3.x compatibility Mechanical translation of the deprecated except x,y: construct with except x as y: The latter works with any Python >= 2.6. Add Hacking check. Change-Id: I845829d97d379c1cd9b3a77e7e5786586f263b64 --- tools/conf/extract_opts.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tools') diff --git a/tools/conf/extract_opts.py b/tools/conf/extract_opts.py index 89f335d9b..deb49f7a9 100644 --- a/tools/conf/extract_opts.py +++ b/tools/conf/extract_opts.py @@ -104,12 +104,12 @@ def _import_module(mod_str): return sys.modules[mod_str[4:]] else: return importutils.import_module(mod_str) - except (ValueError, AttributeError), err: + except (ValueError, AttributeError) as err: return None - except ImportError, ie: + except ImportError as ie: sys.stderr.write("%s\n" % str(ie)) return None - except Exception, e: + except Exception as e: return None -- cgit