#19204: Python2-style exception syntax is still used in django.utils.unittest
(and
should be updated)
-----------------------------------+-------------------------
Reporter: garrison | Owner: nobody
Type: Uncategorized | Status: new
Component: Testing framework | Version: 1.5-alpha-1
Severity: Normal | Keywords: py3k
Triage Stage: Unreviewed | Has patch: 1
Easy pickings: 0 | UI/UX: 0
-----------------------------------+-------------------------
Installing the Django 1.5a1 package through pip on python 3.2 shows some
SyntaxError warnings, due to using python2-style syntax for catching
exceptions:
{{{
/tmp/venv/bin$ ./pip-3.2 install
https://www.djangoproject.com/download/1.5a1/tarball/
Downloading/unpacking
https://www.djangoproject.com/download/1.5a1/tarball/
Downloading (7.7MB): 7.7MB downloaded
Cannot determine compression type for file /tmp/pip-6_1a4e-
unpack/tarball.ksh
Running setup.py egg_info for package from
https://www.djangoproject.com/download/1.5a1/tarball/
warning: no previously-included files matching '__pycache__' found
under directory '*'
warning: no previously-included files matching '*.py[co]' found under
directory '*'
Installing collected packages: Django
Running setup.py install for Django
changing mode of build/scripts-3.2/django-admin.py from 644 to 755
File "/tmp/venv/lib/python3.2/site-
packages/django/utils/unittest/loader.py", line 92
except Exception, e:
^
SyntaxError: invalid syntax
File "/tmp/venv/lib/python3.2/site-
packages/django/utils/unittest/case.py", line 327
except SkipTest, e:
^
SyntaxError: invalid syntax
File "/tmp/venv/lib/python3.2/site-
packages/django/utils/unittest/main.py", line 153
except getopt.error, msg:
^
SyntaxError: invalid syntax
File "/tmp/venv/lib/python3.2/site-
packages/django/utils/unittest/suite.py", line 141
except Exception, e:
^
SyntaxError: invalid syntax
warning: no previously-included files matching '__pycache__' found
under directory '*'
warning: no previously-included files matching '*.py[co]' found under
directory '*'
changing mode of /tmp/venv/bin/django-admin.py to 755
Successfully installed Django
Cleaning up...
}}}
It's not clear to me why these files were not updated with the new
exception syntax, but I've attached a patch that does just that.
--
Ticket URL: <https://code.djangoproject.com/ticket/19204>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.