Permalink
Browse files

fix #183 -- add Session._path_hash, force update_manifest_cache() whe…

…n path changed
  • Loading branch information...
NiklasRosenstein committed Sep 2, 2017
1 parent 05e1773 commit 0591fe39aebffde49132aa025d53f9a34c2bf621
Showing with 7 additions and 0 deletions.
  1. +1 −0 CHANGES.md
  2. +6 −0 craftr/core/session.py
View
@@ -7,6 +7,7 @@ Bugfixes
- Fix `shell.find_program()` when program already has the `.exe` suffix
on Windows
- Fix #182: Java: Multiple -cp,-classpath arguments is incorrect
- Fix #183: Changes to session.path not reflected after first call to load()
- Fix #184: NameError in pyutils.strip_flags: shell is not defined
# v2.0.0
View
@@ -158,6 +158,7 @@ def __init__(self, maindir=None):
self._tempdir = None
self._manifest_cache = {} # maps manifest_filename: manifest
self._refresh_cache = True
self._path_hash = None
def __enter__(self):
if Session.current:
@@ -261,6 +262,11 @@ def parse_manifest(self, filename):
return module
def update_manifest_cache(self, force=False):
# Force update when Session.path changed.
path_hash = hash(tuple(self.path))
if self._path_hash != path_hash:
self._path_hash = path_hash
force = True
if not self._refresh_cache and not force:
return
self._refresh_cache = False

0 comments on commit 0591fe3

Please sign in to comment.