mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #18192: Introduce importlib.util.MAGIC_NUMBER and document the
deprecation of imp.get_magic().
This commit is contained in:
parent
4d7056258b
commit
05a647deed
8 changed files with 37 additions and 8 deletions
|
@ -23,6 +23,7 @@ from importlib._bootstrap import cache_from_source, source_from_cache
|
|||
|
||||
from importlib import _bootstrap
|
||||
from importlib import machinery
|
||||
from importlib import util
|
||||
import importlib
|
||||
import os
|
||||
import sys
|
||||
|
@ -44,8 +45,11 @@ IMP_HOOK = 9
|
|||
|
||||
|
||||
def get_magic():
|
||||
"""Return the magic number for .pyc or .pyo files."""
|
||||
return _bootstrap._MAGIC_BYTES
|
||||
"""**DEPRECATED**
|
||||
|
||||
Return the magic number for .pyc or .pyo files.
|
||||
"""
|
||||
return util.MAGIC_NUMBER
|
||||
|
||||
|
||||
def get_tag():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue