def __fetch_compiled(self, url) :
import marshal
module_src = None
try :
module_compiled = urlopen(url + 'c').read() # from blah.py --> blah.pyc
try :
module_src = marshal.loads(module_compiled[8:]) # Strip the .pyc file header of Python up to 3.3
return module_src
except ValueError :
pass
try :
module_src = marshal.loads(module_compiled[12:])# Strip the .pyc file header of Python 3.3 and onwards (changed .pyc spec)
return module_src
except ValueError :
pass
except IOError as e:
logger.debug("[-] No compiled version ('.pyc') for '%s' module found!" % url.split('/')[-1])
return module_src
评论列表
文章目录