automated change using python-modernize: use 'as' in except
This commit is contained in:
parent
521398d5e7
commit
6caaa8a527
12 changed files with 32 additions and 32 deletions
|
|
@ -57,7 +57,7 @@ class ConfigTestCase(FlaskTestCase):
|
|||
app = flask.Flask(__name__)
|
||||
try:
|
||||
app.config.from_envvar('FOO_SETTINGS')
|
||||
except RuntimeError, e:
|
||||
except RuntimeError as e:
|
||||
self.assert_("'FOO_SETTINGS' is not set" in str(e))
|
||||
else:
|
||||
self.assert_(0, 'expected exception')
|
||||
|
|
@ -76,7 +76,7 @@ class ConfigTestCase(FlaskTestCase):
|
|||
try:
|
||||
app = flask.Flask(__name__)
|
||||
app.config.from_envvar('FOO_SETTINGS')
|
||||
except IOError, e:
|
||||
except IOError as e:
|
||||
msg = str(e)
|
||||
self.assert_(msg.startswith('[Errno 2] Unable to load configuration '
|
||||
'file (No such file or directory):'))
|
||||
|
|
@ -91,7 +91,7 @@ class ConfigTestCase(FlaskTestCase):
|
|||
app = flask.Flask(__name__)
|
||||
try:
|
||||
app.config.from_pyfile('missing.cfg')
|
||||
except IOError, e:
|
||||
except IOError as e:
|
||||
msg = str(e)
|
||||
self.assert_(msg.startswith('[Errno 2] Unable to load configuration '
|
||||
'file (No such file or directory):'))
|
||||
|
|
@ -141,7 +141,7 @@ class InstanceTestCase(FlaskTestCase):
|
|||
here = os.path.abspath(os.path.dirname(__file__))
|
||||
try:
|
||||
flask.Flask(__name__, instance_path='instance')
|
||||
except ValueError, e:
|
||||
except ValueError as e:
|
||||
self.assert_('must be absolute' in str(e))
|
||||
else:
|
||||
self.fail('Expected value error')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue