Skip to content

Commit 7579ace

Browse files
committed
check version compatibility for unasync: remove
1 parent 13c4c4f commit 7579ace

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/unasync/__init__.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ def _unasync_file(self, filepath):
7878
tokens = _tokenize(f)
7979
tokens = self._unasync_tokens(tokens)
8080
result = _untokenize(tokens)
81-
result = self._unasync_remove(contents=result, filename=filepath)
81+
# Limit to Python3.8+ until we know how to support older versions
82+
if (sys.version_info[0] == 3 and sys.version_info[1] >= 8) or sys.version_info[0] > 3:
83+
result = self._unasync_remove(contents=result, filename=filepath)
8284
outfilepath = filepath.replace(self.fromdir, self.todir)
8385
_makedirs_existok(os.path.dirname(outfilepath))
8486
with open(outfilepath, "w", **write_kwargs) as f:

0 commit comments

Comments
 (0)