Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
src/sage/__init__.py: Move monkey-patch of ExtensionFileLoader to src…
Browse files Browse the repository at this point in the history
…/sage/cpython/__init__.py
  • Loading branch information
Matthias Koeppe committed Sep 8, 2021
1 parent f77a98e commit 2e9ea56
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
10 changes: 0 additions & 10 deletions src/sage/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,6 @@ def isfunction(obj):
inspect.isfunction = isfunction


# Monkey-patch ExtensionFileLoader to allow IPython to find the sources
# of Cython files. See https://trac.sagemath.org/ticket/24681
try:
from importlib.machinery import ExtensionFileLoader
except ImportError:
pass # Python 2
else:
del ExtensionFileLoader.get_source


# Work around a Cygwin-specific bug caused by sqlite3; see
# https://trac.sagemath.org/ticket/30157 and the docstring for
# fix_for_ticket_30157
Expand Down
6 changes: 6 additions & 0 deletions src/sage/cpython/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@
# to prevent the system zlib to be loaded instead of the Sage one.
# See https://trac.sagemath.org/ticket/23122
import zlib as _zlib


# Monkey-patch ExtensionFileLoader to allow IPython to find the sources
# of Cython files. See https://trac.sagemath.org/ticket/24681
from importlib.machinery import ExtensionFileLoader as _ExtensionFileLoader
del _ExtensionFileLoader.get_source

0 comments on commit 2e9ea56

Please sign in to comment.