running lib2to3.fixes.fix_except
This commit is contained in:
1 parent
14830e8906
commit
35900da19b
35 files changed
+93
-92
No files matched your search
@@ -175,7 +175,7 @@ class TestIsUrl(unittest.TestCase):
|
||||
try:
|
||||
x = IS_URL(mode='ftp')
|
||||
x('http://www.google.ca')
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
if str(e) != "invalid mode 'ftp' in IS_URL":
|
||||
self.fail('Wrong exception: ' + str(e))
|
||||
else:
|
||||
@@ -188,7 +188,7 @@ class TestIsUrl(unittest.TestCase):
|
||||
prepend_scheme='ftp')
|
||||
x('http://www.benn.ca') # we can only reasonably know about the
|
||||
# error at calling time
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
if str(e)\
|
||||
!= "allowed_scheme value 'ftp' is not in [None, 'http', 'https']":
|
||||
self.fail('Wrong exception: ' + str(e))
|
||||
@@ -203,7 +203,7 @@ class TestIsUrl(unittest.TestCase):
|
||||
x = IS_URL(prepend_scheme='ftp')
|
||||
x('http://www.benn.ca') # we can only reasonably know about the
|
||||
# error at calling time
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
if str(e)\
|
||||
!= "prepend_scheme='ftp' is not in allowed_schemes=[None, 'http', 'https']":
|
||||
self.fail('Wrong exception: ' + str(e))
|
||||
@@ -215,7 +215,7 @@ class TestIsUrl(unittest.TestCase):
|
||||
|
||||
try:
|
||||
x = IS_URL(allowed_schemes=[None, 'https'])
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
if str(e)\
|
||||
!= "prepend_scheme='http' is not in allowed_schemes=[None, 'https']":
|
||||
self.fail('Wrong exception: ' + str(e))
|
||||
@@ -227,7 +227,7 @@ class TestIsUrl(unittest.TestCase):
|
||||
try:
|
||||
x = IS_URL(allowed_schemes=[None, 'http'],
|
||||
prepend_scheme='https')
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
if str(e)\
|
||||
!= "prepend_scheme='https' is not in allowed_schemes=[None, 'http']":
|
||||
self.fail('Wrong exception: ' + str(e))
|
||||
@@ -239,7 +239,7 @@ class TestIsUrl(unittest.TestCase):
|
||||
try:
|
||||
x = IS_URL(mode='generic', allowed_schemes=[None, 'ftp',
|
||||
'ftps'])
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
if str(e)\
|
||||
!= "prepend_scheme='http' is not in allowed_schemes=[None, 'ftp', 'ftps']":
|
||||
self.fail('Wrong exception: ' + str(e))
|
||||
@@ -253,7 +253,7 @@ class TestIsUrl(unittest.TestCase):
|
||||
x = IS_URL(mode='generic', prepend_scheme='blargg')
|
||||
x('http://www.google.ca')
|
||||
# we can only reasonably know about the error at calling time
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
if not str(e).startswith(
|
||||
"prepend_scheme='blargg' is not in allowed_schemes="):
|
||||
self.fail('Wrong exception: ' + str(e))
|
||||
@@ -265,7 +265,7 @@ class TestIsUrl(unittest.TestCase):
|
||||
try:
|
||||
x = IS_URL(mode='generic', allowed_schemes=[None, 'http'],
|
||||
prepend_scheme='blargg')
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
if str(e)\
|
||||
!= "prepend_scheme='blargg' is not in allowed_schemes=[None, 'http']":
|
||||
self.fail('Wrong exception: ' + str(e))
|
||||
@@ -567,7 +567,7 @@ class TestIsHttpUrl(unittest.TestCase):
|
||||
|
||||
try:
|
||||
IS_HTTP_URL(prepend_scheme='mailto')
|
||||
except Exception, e:
|
||||
except Exception as e:
|
||||
if str(e)\
|
||||
!= "prepend_scheme='mailto' is not in allowed_schemes=[None, 'http', 'https']":
|
||||
self.fail('Wrong exception: ' + str(e))
|
||||
|
||||
Reference in new issue
Block a user