-
Notifications
You must be signed in to change notification settings - Fork 23
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
Add support for Python 3.5 #31
Conversation
for x in it: | ||
yield x | ||
|
||
traceback._iter_chain = _iter_chain |
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.
Would it be better to avoid monkey-patching a stdlib module, and instead make _iter_chain
a local function? Something like:
try:
_iter_chain = traceback._iter_chain
except AttributeError:
# Python 3.5
def _iter_chain(...):
...
def format_exception(...):
if chain:
values = _iter_chain(v, tb)
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.
I see, updated :)
# itertools.chain is in an extension module and may be unavailable | ||
for it in its: | ||
for x in it: | ||
yield x |
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.
This looks very similar to traceback._iter_chain() from Python 3.4, but differs in some small details. Where did it come from?
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.
Looks like I looked up a somewhat outdated copy of that file, sorry for this. Link to the copy I used: http://svn.python.org/projects/python/branches/pep-0384/Lib/traceback.py
I'm going to update the PR using a more recent version (with a little adjustment to the "yield from" part, as that's an invalid syntax for Python 2)
LGTM. Do we need a new zope.testrunner release on PyPI to support Python 3.5 for other zope.* packages that use zope.testrunner to run their tests? |
I didn't run into problems with testrunner when running tests of other zope.* packages yet, but a new release would be safer :) |
This addresses #30