simplify
This commit is contained in:
parent
c7d120ec1c
commit
fefdca5787
|
@ -155,13 +155,10 @@ def _use_cached_pyc(source, cache):
|
||||||
fp.close()
|
fp.close()
|
||||||
except EnvironmentError:
|
except EnvironmentError:
|
||||||
return False
|
return False
|
||||||
if (len(data) != 8 or
|
# Check for invalid or out of date pyc file.
|
||||||
data[:4] != imp.get_magic() or
|
return (len(data) == 8 and
|
||||||
struct.unpack("<l", data[4:])[0] != mtime):
|
data[:4] == imp.get_magic() and
|
||||||
# Invalid or out of date.
|
struct.unpack("<l", data[4:])[0] == mtime)
|
||||||
return False
|
|
||||||
# The cached pyc exists and is up to date.
|
|
||||||
return True
|
|
||||||
|
|
||||||
def _cache_pyc(state, pyc, cache):
|
def _cache_pyc(state, pyc, cache):
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue