This commit is contained in:
Benjamin Peterson 2011-06-29 14:00:13 -05:00
parent c7d120ec1c
commit fefdca5787
1 changed files with 4 additions and 7 deletions

View File

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