Merge lp:~jseutter/testtools/py3_again into lp:~testtools-committers/testtools/trunk
Proposed by
Jerry Seutter
Status: | Needs review |
---|---|
Proposed branch: | lp:~jseutter/testtools/py3_again |
Merge into: | lp:~testtools-committers/testtools/trunk |
Diff against target: |
48 lines (+12/-5) 3 files modified
setup.py (+10/-2) testtools/_compat2x.py (+0/-1) testtools/compat.py (+2/-2) |
To merge this branch: | bzr merge lp:~jseutter/testtools/py3_again |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Robert Collins | Needs Fixing | ||
Barry Warsaw | Pending | ||
Review via email: mp+105569@code.launchpad.net |
Description of the change
This is a new MP based off https:/
This change adds support for building and installing using python 3. Previously this package could be used in both python 2 and python 3, but a "python setup.py install" using python 3 would fail when trying to compile _compat2x.py.
get_revno() will now silently fail if bzrlib is not present, as bzrlib is not yet available in python 3.
To post a comment you must log in.
Unmerged revisions
- 262. By Jerry Seutter
-
Merging in Barry's fixes to setup.py and _compat2x.py.
- 261. By Jerry Seutter
-
Adding Python 3 support.
the change to raise is invalid - it causes the wrong exception to be raised. AFAIK there is no way to do it compatibly with python 3, which is why that file isn't menat to be compiled on python3.
We don't want get_revno() to silently fail if bzrlib is not present - get_revno is required for non-final versions.
The change to not catch SyntaxError makes sense, but I'm sorry, the other bits do not. I'll cherrypick that component into trunk tomorrowish. I'm marking this needs-fixing so noone just-merges it, but you don't need to do furhter work - I'll cherrypick the bits out. If you want to figure out how to not install _compat2x.py on python3, that would be excellent, and probably fix the bytecompilation error.
>>> try: ValueError' > ValueError' >
... try:
... raise ValueError("foo")
... except ValueError:
... raise sys.exc_info()
... except ValueError, e:
... print e, type(e)
...
<type 'exceptions.
>>> try:
... try:
... raise ValueError("foo")
... except ValueError:
... c,o,t = sys.exc_info()
... raise c,o,t
... except ValueError, e:
... print e, type(e)
...
foo <type 'exceptions.