Commit ef29f10e by Timothée Peignier

Merge pull request #322 from newscred/fix-path-error

check path first
parents 6a186b9b fb7f9c47
...@@ -74,15 +74,16 @@ class GZIPMixin(object): ...@@ -74,15 +74,16 @@ class GZIPMixin(object):
return return
for path in paths: for path in paths:
if path and not matches_patterns(path, self.gzip_patterns): if path:
continue if not matches_patterns(path, self.gzip_patterns):
original_file = self.open(path) continue
gzipped_path = "{0}.gz".format(path) original_file = self.open(path)
if self.exists(gzipped_path): gzipped_path = "{0}.gz".format(path)
self.delete(gzipped_path) if self.exists(gzipped_path):
gzipped_file = self._compress(original_file) self.delete(gzipped_path)
gzipped_path = self.save(gzipped_path, gzipped_file) gzipped_file = self._compress(original_file)
yield gzipped_path, gzipped_path, True gzipped_path = self.save(gzipped_path, gzipped_file)
yield gzipped_path, gzipped_path, True
class NonPackagingMixin(object): class NonPackagingMixin(object):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment