diff options
author | Dieter Verfaillie <dieterv@optionexplicit.be> | 2015-06-16 16:18:03 +0200 |
---|---|---|
committer | Dieter Verfaillie <dieterv@optionexplicit.be> | 2015-06-29 16:54:18 +0200 |
commit | 0fcbad89ce10f6927d03666e7ea290cf17883114 (patch) | |
tree | bd40a616d897c438b70800bea15f9298156cf412 /giscanner/cachestore.py | |
parent | 2c443193ab245633794cd84b60e2c64b88d6cfb8 (diff) | |
download | gobject-introspection-0fcbad89ce10f6927d03666e7ea290cf17883114.tar.gz |
scanner: future-proof cachestore version hashing
Python 3 does not write .pyc files like Python 2
used to do but instead put's them in a __pycache__
directory. Simply compute the version hash using
the .py files instead.
Diffstat (limited to 'giscanner/cachestore.py')
-rw-r--r-- | giscanner/cachestore.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/giscanner/cachestore.py b/giscanner/cachestore.py index c588792d..d6120706 100644 --- a/giscanner/cachestore.py +++ b/giscanner/cachestore.py @@ -37,8 +37,7 @@ _CACHE_VERSION_FILENAME = '.cache-version' def _get_versionhash(): toplevel = os.path.dirname(giscanner.__file__) - # Use pyc instead of py to avoid extra IO - sources = glob.glob(os.path.join(toplevel, '*.pyc')) + sources = glob.glob(os.path.join(toplevel, '*.py')) sources.append(sys.argv[0]) # Using mtimes is a bit (5x) faster than hashing the file contents mtimes = (str(os.stat(source).st_mtime) for source in sources) |