summaryrefslogtreecommitdiffstats
path: root/Lib/imp.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/imp.py')
-rw-r--r--Lib/imp.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/Lib/imp.py b/Lib/imp.py
index dab8312..58d1c97 100644
--- a/Lib/imp.py
+++ b/Lib/imp.py
@@ -10,12 +10,12 @@ from _imp import (lock_held, acquire_lock, release_lock,
load_dynamic, get_frozen_object, is_frozen_package,
init_builtin, init_frozen, is_builtin, is_frozen,
_fix_co_filename, extension_suffixes)
-# Could move out of _imp, but not worth the code
-from _imp import get_magic
+# Directly exposed by this module
from importlib._bootstrap import new_module
from importlib._bootstrap import cache_from_source
+
from importlib import _bootstrap
from importlib import machinery
import os
@@ -37,6 +37,11 @@ PY_CODERESOURCE = 8
IMP_HOOK = 9
+def get_magic():
+ """Return the magic number for .pyc or .pyo files."""
+ return _bootstrap._MAGIC_BYTES
+
+
def get_tag():
"""Return the magic tag for .pyc or .pyo files."""
return sys.implementation.cache_tag