Skip to content

Commit

Permalink
check version compatibility for unasync: remove
Browse files Browse the repository at this point in the history
  • Loading branch information
spyoungtech committed Jul 14, 2022
1 parent 13c4c4f commit 7579ace
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/unasync/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ def _unasync_file(self, filepath):
tokens = _tokenize(f)
tokens = self._unasync_tokens(tokens)
result = _untokenize(tokens)
result = self._unasync_remove(contents=result, filename=filepath)
# Limit to Python3.8+ until we know how to support older versions
if (sys.version_info[0] == 3 and sys.version_info[1] >= 8) or sys.version_info[0] > 3:
result = self._unasync_remove(contents=result, filename=filepath)
outfilepath = filepath.replace(self.fromdir, self.todir)
_makedirs_existok(os.path.dirname(outfilepath))
with open(outfilepath, "w", **write_kwargs) as f:
Expand Down

0 comments on commit 7579ace

Please # to comment.