[gobject-introspection/wip/dieterv/drive-by-review: 1/13] scanner: fix cachestore version hashing



commit f922af8cc55d975eb46d3a236e858d5efe6bd401
Author: Dieter Verfaillie <dieterv optionexplicit be>
Date:   Tue Jun 16 16:18:03 2015 +0200

    scanner: fix 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.

 giscanner/cachestore.py |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/giscanner/cachestore.py b/giscanner/cachestore.py
index c588792..d612070 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)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]