Skip to content

Commit

Permalink
Merge branch 'master' into unstable
Browse files Browse the repository at this point in the history
  • Loading branch information
suoto committed Mar 11, 2017
2 parents 62cae91 + 2a06c68 commit a740dab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion hdlcc/builders/ghdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def _makeRecords(self, line):
def _checkEnvironment(self):
stdout = self._subprocessRunner(['ghdl', '--version'])
self._version = \
re.findall(r"(?<=GHDL)\s+([\w\.]+)\s+", \
re.findall(r"(?<=GHDL)\s+([^\s]+)\s+", \
stdout[0])[0]
self._logger.info("GHDL version string: '%s'. " + \
"Version number is '%s'", \
Expand Down
7 changes: 4 additions & 3 deletions hdlcc/parsers/base_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ def __init__(self, filename, library='work', flags=None):
self._content = None
self._mtime = 0
self.filetype = getFileType(self.filename)

self._prev = None

self.abspath = p.abspath(filename)

def getState(self):
Expand Down Expand Up @@ -122,7 +124,6 @@ def _changed(self):
provided by p.getmtime
"""
if self.getmtime() > self._mtime:
_logger.debug("File '%s' has changed", self.filename)
return True
return False

Expand All @@ -135,7 +136,7 @@ def _clearCachesIfChanged(self):
# Since the content was set by the caller, we can't really clear
# this unless we're handling with a proper file
if not self.hasBufferContent(): # pragma: no cover
self._content = None
self._content = None
self._cache = {}

def getmtime(self):
Expand Down Expand Up @@ -203,6 +204,7 @@ def getSourceContent(self):
"""
Cached version of the _getSourceContent method
"""

self._clearCachesIfChanged()

if self._content is None:
Expand All @@ -220,7 +222,6 @@ def getRawSourceContent(self):

if self.hasBufferContent():
return self._content

if 'raw_content' not in self._cache or self._changed():
self._cache['raw_content'] = \
open(self.filename, mode='rb').read().decode(errors='ignore')
Expand Down

0 comments on commit a740dab

Please sign in to comment.