Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
pypy
pypy
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 594
    • Issues 594
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 10
    • Merge Requests 10
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

This instance was upgraded to Heptapod 0.20rc3 today

  • PyPy
  • pypypypy
  • Issues
  • #3394

Closed
Open
Opened Feb 06, 2021 by Julian Berman@JulianDeveloper

pypy REPL crashes when sys.excepthook is broken

Compare at a REPL with cpython the (broken):

⊙  python3.8                                                                julian@Home ● Python 3.8.7 (default, Feb  3 2021, 06:31:03)
[Clang 12.0.0 (clang-1200.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys; sys.excepthook = object(); asdf
Error in sys.excepthook:
TypeError: 'object' object is not callable

Original exception was:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'asdf' is not defined
>>>

where in PyPy3:

⊙  pypy3                                                                     julian@Home
Python 3.7.9 (7e6e2bb30ac5fbdbd443619cae28c51d5c162a02, Dec 30 2020, 17:59:49)
[PyPy 7.3.3-beta0 with GCC Apple LLVM 12.0.0 (clang-1200.0.32.28)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
And now for something completely different: ``<antocuni> I'm glad that we
program in Python and we don't deal with those issues every day. Apart the fact
that we have to deal with them anyway, it seems''
>>>> import sys; sys.excepthook = object(); asdf
Error calling sys.excepthook:
Traceback (most recent call last):
  File "<builtin>/app_main.py", line 166, in display_exception
TypeError: 'object' object is not callable

Original exception was:
Traceback (most recent call last):
  File "/usr/local/Cellar/pypy3/7.3.3/libexec/lib-python/3/code.py", line 90, in runcode
    exec(code, self.locals)
  File "<stdin>", line 1, in <module>
NameError: name 'asdf' is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/Cellar/pypy3/7.3.3/libexec/lib_pypy/_pypy_interact.py", line 45, in interactive_console
    run_interactive(mainmodule)
  File "/usr/local/Cellar/pypy3/7.3.3/libexec/lib_pypy/pyrepl/simple_interact.py", line 80, in run_multiline_interactive_console
    more = console.push(_strip_final_indent(statement))
  File "/usr/local/Cellar/pypy3/7.3.3/libexec/lib-python/3/code.py", line 258, in push
    more = self.runsource(source, self.filename)
  File "/usr/local/Cellar/pypy3/7.3.3/libexec/lib-python/3/code.py", line 74, in runsource
    self.runcode(code)
  File "/usr/local/Cellar/pypy3/7.3.3/libexec/lib-python/3/code.py", line 94, in runcode
    self.showtraceback()
  File "/usr/local/Cellar/pypy3/7.3.3/libexec/lib-python/3/code.py", line 148, in showtraceback
    sys.excepthook(ei[0], ei[1], last_tb)
TypeError: 'object' object is not callable

and after which the REPL exits.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: pypy/pypy#3394