Skip to content

Commit

Permalink
Fix #12: don't rely on empty string to signify a resolved but unavail…
Browse files Browse the repository at this point in the history
…able executable path
  • Loading branch information
jdidion committed Jun 14, 2017
1 parent 57cfa73 commit 782bf28
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 3 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
v3.0.2 (dev)
------------
v3.0.2 (2017.06.14)
-------------------
* Forcing use of backports.typing for python < 3.6.
* Added basic performance testing.
* Fixed #12: xphyle not recognizing when system-level lzma not installed.

v3.0.1 (2017.04.29)
-------------------
Expand Down
7 changes: 3 additions & 4 deletions xphyle/formats.py
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,7 @@ class SingleExeCompressionFormat(CompressionFormat): # pylint: disable=abstract-
def __init__(self):
self._executable_path = None
self._executable_name = None
self._resolved = False

@property
def executable_path(self) -> PathLike:
Expand Down Expand Up @@ -707,13 +708,11 @@ def decompress_name(self) -> str:
return self.executable_name

def _resolve_executable(self) -> None:
if self._executable_path is None:
if not self._resolved:
exe = EXECUTABLE_CACHE.resolve_exe(self.system_commands)
if exe:
self._executable_path, self._executable_name = exe
else:
self._executable_path = self._executable_name = ''

self._resolved = True

class GzipBase(SingleExeCompressionFormat):
"""Base class for gzip and bgzip files.
Expand Down

0 comments on commit 782bf28

Please sign in to comment.