New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
conform to pep 3110 #2064
conform to pep 3110 #2064
Conversation
brutally replace all `exeption <type>, <name>:` by `exception <type> as <name> :` `exception <type>, <type> :` should not be present anywhere in the code anymore, or should be present with explicit tuple as `exception (<type>, <type>)`
I think these are all good, but let's run a test_pr just to be safe... |
Test results for commit 28b538a merged into master
Not available for testing: python3.1, python3.2 |
This make me think, there is a lot a "fixes" that 2to3 can apply independently to the all source tree and that will still be python2.x compatible. Do we want to start applying them to have a smoother transition to a fully dirrectly python3 compatible version of IPython ? I think the hardest part will be the [edit :] |
2to3 makes a better job than regexp
On Sun, Jul 1, 2012 at 9:13 AM, Bussonnier Matthias
In principle I agree with you, but I'd like to hear @takluyver's |
I like this approach - I find I've also been meaning to find all the files which use the ugly |
let's see this one as a first step. |
It looks like it's called |
this should allow a more compatible codebase between python 2.x and 3.x
skip |
Test results for commit 1c49f84 merged into master
Not available for testing: python3.1, python3.2 |
@@ -234,6 +234,12 @@ def cleanup(): | |||
|
|||
if PY3: | |||
setuptools_extra_args['use_2to3'] = True | |||
# we try to make a 2.6, 2.7, and 3.1 to 3.3 python compatible code | |||
# so we explicitely disable some 2to3 fixes to be sure we ain't forgetting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'explicitly'. Also, "ain't" is colloquial - we should use "aren't", so that it's clear to people who're less familiar with English.
Test results for commit 1c49f84 merged into master
Not available for testing: python2.6, python3.1 |
fixed, |
Thanks. Skipping deathrow and quarantine should be fine, as they don't get installed. If anyone updates those, we'll need to check they use the new style - but The only other thing to consider is that we're changing external modules, especially pexpect, so we can send the changes upstream (although they might be rejected by projects which still want to support Python < 2.6). |
Hum, checking again it seems like I did apply 2to3 fo deathrow and quarantine, a pexpect seem to be dead for 3 years now... |
I know, I had to fork it: http://pypi.python.org/pypi/pexpect-u It looks like SSH is just an adapted example, not a real upstream package, so I think we're all OK. |
Just rerunning the tests. @minrk , any objections to merging this one? It doesn't introduce any ugliness, and I think the new syntax is clearer. |
Test results for commit 3f213ee merged into master
Not available for testing: python2.6 |
No objection from me. |
Use new style "except Exception as e" syntax.
Great, I've merged this. |
On Wed, Jul 4, 2012 at 1:51 PM, Thomas Kluyver
+1 |
Use new style "except Exception as e" syntax.
brutally replace all
exeption <type>, <name>:
byexception <type> as <name> :
exception <type>, <type> :
should not be present anywhere in the codeanymore, or should be present with explicit tuple as
exception (<type>, <type>) :
see also #2061