mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Fixed #18013 -- Use the new 'as' syntax for exceptions.
Thanks Clueless for the initial patch. Note that unittest has been purposely left out (external package only used by Python 2.6).
This commit is contained in:
parent
eefb00f301
commit
3904b74a3f
107 changed files with 306 additions and 354 deletions
|
@ -569,7 +569,7 @@ class ThreadTests(TestCase):
|
|||
connections['default'] = main_thread_connection
|
||||
try:
|
||||
models.Person.objects.get(first_name="John", last_name="Doe")
|
||||
except DatabaseError, e:
|
||||
except DatabaseError as e:
|
||||
exceptions.append(e)
|
||||
t = threading.Thread(target=runner, args=[connections['default']])
|
||||
t.start()
|
||||
|
@ -607,7 +607,7 @@ class ThreadTests(TestCase):
|
|||
def runner2(other_thread_connection):
|
||||
try:
|
||||
other_thread_connection.close()
|
||||
except DatabaseError, e:
|
||||
except DatabaseError as e:
|
||||
exceptions.add(e)
|
||||
t2 = threading.Thread(target=runner2, args=[connections['default']])
|
||||
t2.start()
|
||||
|
@ -624,7 +624,7 @@ class ThreadTests(TestCase):
|
|||
def runner2(other_thread_connection):
|
||||
try:
|
||||
other_thread_connection.close()
|
||||
except DatabaseError, e:
|
||||
except DatabaseError as e:
|
||||
exceptions.add(e)
|
||||
# Enable thread sharing
|
||||
connections['default'].allow_thread_sharing = True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue