Merge lp:~lifeless/bzr/py3 into lp:bzr
Proposed by
Robert Collins
on 2010-06-21
| Status: | Merged |
|---|---|
| Approved by: | John A Meinel on 2010-06-21 |
| Approved revision: | no longer in the revision history of the source branch. |
| Merged at revision: | 5314 |
| Proposed branch: | lp:~lifeless/bzr/py3 |
| Merge into: | lp:bzr |
| Diff against target: |
145 lines (+40/-37) 1 file modified
setup.py (+40/-37) |
| To merge this branch: | bzr merge lp:~lifeless/bzr/py3 |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| John A Meinel | 2010-06-21 | Needs Fixing on 2010-06-21 | |
|
Review via email:
|
|||
Commit Message
Make setup.py python 3.1 compatible.
Description of the Change
Make setup.py importable under python3.1.
To post a comment you must log in.
lp:~lifeless/bzr/py3
updated
on 2010-06-21
- 5312. By Canonical.com Patch Queue Manager <email address hidden> on 2010-06-21
-
(lifeless) Return self from the new context managers so that new objects
used with with statements are usable. (Robert Collins)
| Robert Collins (lifeless) wrote : | # |
sent to pqm by email
lp:~lifeless/bzr/py3
updated
on 2010-06-22

This isn't completely correct yet. For example:
8 - print "Created:", batch_path
9 - except Exception, e:
10 - print "ERROR: Unable to create %s: %s" % (batch_path, e)
11 + print("Created:", batch_path)
12 + except Exception:
13 + e = sys.exc_info()[1]
14 + print("ERROR: Unable to create %s: %s" % (batch_path, e))
In python2.6 this will print:
('Created:', 'the-batch-path')
You need to you use the %s form:
print("Created: %s" % (batch_path,))
I don't really like that the code is even uglier (setup.py is pretty messy to start with). I'm not really sure the benefit of making it 3.x compatible, given that the rest of the code isn't, but I guess you have to start somewhere.