• Brett Cannon's avatar
    Make importlib compatible with __import__ by "fixing" code.co_filename · 442c9b92
    Brett Cannon yazdı
    paths.
    
    __import__ does a little trick when importing from bytecode by
    back-patching the co_filename paths to point to the file location
    where the code object was loaded from, *not* where the code object was
    originally created. This allows co_filename to point to a valid path.
    Problem is that co_filename is immutable from Python, so a private
    function -- imp._fix_co_filename() -- had to be introduced in order to
    get things working properly. Originally the plan was to add a file
    argument to marshal.loads(), but that failed as the algorithm used by
    __import__ is not fully recursive as one might expect, so to be fully
    backwards-compatible the code used by __import__ needed to be exposed.
    
    This closes issue #6811 by taking a different approach than outlined
    in the issue.
    442c9b92
Adı
Son kayıt (commit)
Son güncelleme
..
RPM Loading commit data...
TextMate/Python-Dev.tmbundle Loading commit data...
Vim Loading commit data...
ACKS Loading commit data...
HISTORY Loading commit data...
NEWS Loading commit data...
Porting Loading commit data...
README Loading commit data...
README.AIX Loading commit data...
README.coverity Loading commit data...
README.valgrind Loading commit data...
SpecialBuilds.txt Loading commit data...
build.sh Loading commit data...
gdbinit Loading commit data...
indent.pro Loading commit data...
python-config.in Loading commit data...
python-wing3.wpr Loading commit data...
python-wing4.wpr Loading commit data...
python.man Loading commit data...
python.pc.in Loading commit data...
svnmap.txt Loading commit data...
valgrind-python.supp Loading commit data...
vgrindefs Loading commit data...