Issue #18192: Introduce importlib.util.MAGIC_NUMBER and document the

deprecation of imp.get_magic().
This commit is contained in:
Brett Cannon 2013-06-14 19:02:34 -04:00
parent 4d7056258b
commit 05a647deed
8 changed files with 37 additions and 8 deletions

View file

@ -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():