Merge pull request #2064 from Carreau/pep-3110

Use new style "except Exception as e" syntax.
This commit is contained in:
Thomas Kluyver 2012-07-04 13:50:45 -07:00
commit b43f24da5f
2 changed files with 7 additions and 1 deletions

View File

@ -447,7 +447,7 @@ class NotebookApp(BaseIPythonApplication):
for port in random_ports(self.port, self.port_retries+1):
try:
self.http_server.listen(port, self.ip)
except socket.error, e:
except socket.error as e:
if e.errno != errno.EADDRINUSE:
raise
self.log.info('The port %i is already in use, trying another random port.' % port)

View File

@ -265,6 +265,12 @@ if 'setuptools' in sys.modules:
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 explicitly disable some 2to3 fixes to be sure we aren't forgetting
# anything.
setuptools_extra_args['use_2to3_exclude_fixers'] = [
'lib2to3.fixes.fix_except',
]
from setuptools.command.build_py import build_py
setup_args['cmdclass'] = {'build_py': record_commit_info('IPython', build_cmd=build_py)}
setuptools_extra_args['entry_points'] = find_scripts(True, suffix='3')