[gobject-introspection] scanner: future-proof cachestore version hashing



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

    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.

 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]