diff options
| author | Dirk Mueller <dirk@dmllr.de> | 2013-06-07 15:50:39 +0200 |
|---|---|---|
| committer | Dirk Mueller <dirk@dmllr.de> | 2013-06-07 15:50:39 +0200 |
| commit | 2f013887c20310c522f9494ed854554e6f8c7aa4 (patch) | |
| tree | 1f983ff5dcf2f1a2b3dc8b5e896838ef2ccd5cba /openstack/common | |
| parent | 5ce33b2adcf2477fe1192d7061cf49a8ab1a44a2 (diff) | |
| download | oslo-2f013887c20310c522f9494ed854554e6f8c7aa4.tar.gz oslo-2f013887c20310c522f9494ed854554e6f8c7aa4.tar.xz oslo-2f013887c20310c522f9494ed854554e6f8c7aa4.zip | |
Use Python 3.x compatible except construct
Per (proposed) Hacking H203 check, always use the
except x as y: construct, which works with any
Python version >= 2.6, including Python 3.x.
Change-Id: I46028647d5a2a53ba8e9ce4d2e8fc6e71850fdae
Diffstat (limited to 'openstack/common')
| -rwxr-xr-x | openstack/common/config/generator.py | 2 | ||||
| -rw-r--r-- | openstack/common/processutils.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/openstack/common/config/generator.py b/openstack/common/config/generator.py index 4251c87..3f66f74 100755 --- a/openstack/common/config/generator.py +++ b/openstack/common/config/generator.py @@ -207,7 +207,7 @@ def _print_opt(opt): opt_type = None try: opt_type = OPTION_REGEX.search(str(type(opt))).group(0) - except (ValueError, AttributeError), err: + except (ValueError, AttributeError) as err: sys.stderr.write("%s\n" % str(err)) sys.exit(1) opt_help += ' (' + OPT_TYPES[opt_type] + ')' diff --git a/openstack/common/processutils.py b/openstack/common/processutils.py index 1aa1335..02cfada 100644 --- a/openstack/common/processutils.py +++ b/openstack/common/processutils.py @@ -203,7 +203,7 @@ def trycmd(*args, **kwargs): try: out, err = execute(*args, **kwargs) failed = False - except ProcessExecutionError, exn: + except ProcessExecutionError as exn: out, err = '', str(exn) failed = True |
