From f930f38143ab2dc5fd4b570f3a7bcf599ed9b344 Mon Sep 17 00:00:00 2001 From: Radostin Stoyanov Date: Thu, 13 Apr 2017 15:06:30 +0100 Subject: Python 3/2 compatibility: exceptions handling Examine an exception during exception handling in Python3 is done with 'as' instead of comma. This approach works in Python2 as well. https://wiki.python.org/moin/HandlingExceptions --- virt-bootstrap.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'virt-bootstrap.py') diff --git a/virt-bootstrap.py b/virt-bootstrap.py index 3cd520a..e475cd4 100644 --- a/virt-bootstrap.py +++ b/virt-bootstrap.py @@ -107,9 +107,9 @@ Example supported URI formats: bootstrap(args) sys.exit(0) - except KeyboardInterrupt, e: + except KeyboardInterrupt as e: sys.exit(0) - except ValueError, e: + except ValueError as e: for line in e: for l in line: sys.stderr.write("%s: %s\n" % (sys.argv[0], l)) -- cgit