mirror of https://github.com/zulip/zulip.git
Apply Python 3 futurize transform lib2to3.fixes.fix_except
This commit is contained in:
parent
e804185ae6
commit
f3d387e727
|
@ -44,7 +44,7 @@ import sys
|
|||
try:
|
||||
import dateutil.parser
|
||||
import dateutil.tz
|
||||
except ImportError, e:
|
||||
except ImportError as e:
|
||||
print >>sys.stderr, e
|
||||
print >>sys.stderr, "Please install the python-dateutil package."
|
||||
exit(1)
|
||||
|
|
|
@ -40,7 +40,7 @@ from datetime import datetime, timedelta
|
|||
|
||||
try:
|
||||
import dateutil.parser
|
||||
except ImportError, e:
|
||||
except ImportError as e:
|
||||
print >>sys.stderr, e
|
||||
print >>sys.stderr, "Please install the python-dateutil package."
|
||||
exit(1)
|
||||
|
|
|
@ -87,7 +87,7 @@ def mkdir_p(path):
|
|||
# Python doesn't have an analog to `mkdir -p` < Python 3.2.
|
||||
try:
|
||||
os.makedirs(path)
|
||||
except OSError, e:
|
||||
except OSError as e:
|
||||
if e.errno == errno.EEXIST and os.path.isdir(path):
|
||||
pass
|
||||
else:
|
||||
|
|
|
@ -163,7 +163,7 @@ for tries in xrange(10):
|
|||
if missing == 0:
|
||||
actually_subscribed = True
|
||||
break
|
||||
except IOError, e:
|
||||
except IOError as e:
|
||||
if "SERVNAK received" in e:
|
||||
logger.error("SERVNAK repeatedly received, punting rest of test")
|
||||
else:
|
||||
|
|
|
@ -20,7 +20,7 @@ def mkdir_p(path):
|
|||
# Python doesn't have an analog to `mkdir -p` < Python 3.2.
|
||||
try:
|
||||
os.makedirs(path)
|
||||
except OSError, e:
|
||||
except OSError as e:
|
||||
if e.errno == errno.EEXIST and os.path.isdir(path):
|
||||
pass
|
||||
else:
|
||||
|
@ -98,6 +98,6 @@ if __name__ == "__main__":
|
|||
finally:
|
||||
try:
|
||||
os.remove(lock_path)
|
||||
except OSError, IOError:
|
||||
except OSError as IOError:
|
||||
pass
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ try:
|
|||
os.environ['DJANGO_SETTINGS_MODULE'] = 'zproject.settings'
|
||||
from django.conf import settings
|
||||
remote_postgres_host = settings.REMOTE_POSTGRES_HOST
|
||||
except ImportError, e:
|
||||
except ImportError as e:
|
||||
# process_fts_updates also supports running locally on a remote
|
||||
# postgres server; in that case, one can just connect to localhost
|
||||
remote_postgres_host = ''
|
||||
|
|
|
@ -182,7 +182,7 @@ def make_header(repo, opts, revs):
|
|||
print "Attempting to push %s to remote %s" % (local_name, remote)
|
||||
repo.git.push(remote, local_name)
|
||||
tip_name = '%s (%s)' % (local_name, revs[-1].hexsha[:7])
|
||||
except git.GitCommandError, e:
|
||||
except git.GitCommandError as e:
|
||||
print >>sys.stderr, "ERROR: Couldn't push %s to remote" % (local_name,)
|
||||
print >>sys.stderr, e
|
||||
sys.exit(1)
|
||||
|
|
|
@ -37,7 +37,7 @@ def mkdir_p(path):
|
|||
# Python doesn't have an analog to `mkdir -p` < Python 3.2.
|
||||
try:
|
||||
os.makedirs(path)
|
||||
except OSError, e:
|
||||
except OSError as e:
|
||||
if e.errno == errno.EEXIST and os.path.isdir(path):
|
||||
pass
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue