Merge lp:~lifeless/bzr/py3 into lp:bzr
Proposed by
Robert Collins
Status: | Merged |
---|---|
Approved by: | John A Meinel |
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 | Needs Fixing | ||
Review via email: mp+28113@code.launchpad.net |
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.
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.