Apply Python 3 futurize transform lib2to3.fixes.fix_except
This commit is contained in:
parent
8c188cda49
commit
5272ca0674
|
@ -163,7 +163,7 @@ for tries in xrange(10):
|
||||||
if missing == 0:
|
if missing == 0:
|
||||||
actually_subscribed = True
|
actually_subscribed = True
|
||||||
break
|
break
|
||||||
except IOError, e:
|
except IOError as e:
|
||||||
if "SERVNAK received" in e:
|
if "SERVNAK received" in e:
|
||||||
logger.error("SERVNAK repeatedly received, punting rest of test")
|
logger.error("SERVNAK repeatedly received, punting rest of test")
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -20,7 +20,7 @@ def mkdir_p(path):
|
||||||
# Python doesn't have an analog to `mkdir -p` < Python 3.2.
|
# Python doesn't have an analog to `mkdir -p` < Python 3.2.
|
||||||
try:
|
try:
|
||||||
os.makedirs(path)
|
os.makedirs(path)
|
||||||
except OSError, e:
|
except OSError as e:
|
||||||
if e.errno == errno.EEXIST and os.path.isdir(path):
|
if e.errno == errno.EEXIST and os.path.isdir(path):
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
@ -98,6 +98,6 @@ if __name__ == "__main__":
|
||||||
finally:
|
finally:
|
||||||
try:
|
try:
|
||||||
os.remove(lock_path)
|
os.remove(lock_path)
|
||||||
except OSError, IOError:
|
except OSError as IOError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ import sys
|
||||||
try:
|
try:
|
||||||
import dateutil.parser
|
import dateutil.parser
|
||||||
import dateutil.tz
|
import dateutil.tz
|
||||||
except ImportError, e:
|
except ImportError as e:
|
||||||
print >>sys.stderr, e
|
print >>sys.stderr, e
|
||||||
print >>sys.stderr, "Please install the python-dateutil package."
|
print >>sys.stderr, "Please install the python-dateutil package."
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
|
@ -40,7 +40,7 @@ from datetime import datetime, timedelta
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import dateutil.parser
|
import dateutil.parser
|
||||||
except ImportError, e:
|
except ImportError as e:
|
||||||
print >>sys.stderr, e
|
print >>sys.stderr, e
|
||||||
print >>sys.stderr, "Please install the python-dateutil package."
|
print >>sys.stderr, "Please install the python-dateutil package."
|
||||||
exit(1)
|
exit(1)
|
||||||
|
|
|
@ -87,7 +87,7 @@ def mkdir_p(path):
|
||||||
# Python doesn't have an analog to `mkdir -p` < Python 3.2.
|
# Python doesn't have an analog to `mkdir -p` < Python 3.2.
|
||||||
try:
|
try:
|
||||||
os.makedirs(path)
|
os.makedirs(path)
|
||||||
except OSError, e:
|
except OSError as e:
|
||||||
if e.errno == errno.EEXIST and os.path.isdir(path):
|
if e.errno == errno.EEXIST and os.path.isdir(path):
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue