Skip to content
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

Merged
merged 4 commits into from
Nov 9, 2015
Merged

Conversation

felixonmars
Copy link
Contributor

This addresses #30

for x in it:
yield x

traceback._iter_chain = _iter_chain
Copy link
Member

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)

Copy link
Contributor Author

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
Copy link
Member

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?

Copy link
Contributor Author

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)

@mgedmin
Copy link
Member

mgedmin commented Nov 8, 2015

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?

@felixonmars
Copy link
Contributor Author

I didn't run into problems with testrunner when running tests of other zope.* packages yet, but a new release would be safer :)

mgedmin added a commit that referenced this pull request Nov 9, 2015
Add support for Python 3.5
@mgedmin mgedmin merged commit 9b0c659 into zopefoundation:master Nov 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants