Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 601298 - dev-python/flask-0.11.1: _compat code is broken with pypy3
Summary: dev-python/flask-0.11.1: _compat code is broken with pypy3
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Python Gentoo Team
URL: https://github.com/pallets/flask/comm...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-30 16:55 UTC by Michał Górny
Modified: 2016-11-30 19:18 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-11-30 16:55:29 UTC
# Certain versions of pypy have a bug where clearing the exception stack
# breaks the __exit__ function in a very peculiar way.  This is currently
# true for pypy 2.2.1 for instance.  The second level of exception blocks
# is necessary because pypy seems to forget to check if an exception
# happened until the next bytecode instruction?
BROKEN_PYPY_CTXMGR_EXIT = False
if hasattr(sys, 'pypy_version_info'):
    class _Mgr(object):
        def __enter__(self):
            return self
        def __exit__(self, *args):
            sys.exc_clear()


^- this fails on pypy3 since 'sys.exc_clear()' is python2-ism. I guess it'd be good to make the whole block conditional to py2.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-11-30 17:04:56 UTC
Yay, it's fixed upstream. I'll backport the patch.
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-11-30 19:18:09 UTC
commit 1abbfd2cf190c0b55fbd0a55f83de1ed3eeb8946
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: Wed Nov 30 18:11:31 2016
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: Wed Nov 30 19:05:40 2016

    dev-python/flask: Backport PyPy3 fix, #601298