Skip to content

Commit d8a8fc6

Browse files
committed
only require tokenize_rt for python>=3.8
1 parent c38dbf9 commit d8a8fc6

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
include_package_data=True,
2020
packages=find_packages("src"),
2121
package_dir={"": "src"},
22-
install_requires=['tokenize_rt'],
22+
install_requires=['tokenize_rt; python_version >= "3.8.0"'],
2323
keywords=["async"],
2424
python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4",
2525
classifiers=[

src/unasync/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
import os
99
import sys
1010
import tokenize as std_tokenize
11-
from tokenize_rt import reversed_enumerate
12-
from tokenize_rt import src_to_tokens
13-
from tokenize_rt import tokens_to_src
1411

1512
from setuptools.command import build_py as orig
1613

@@ -87,6 +84,10 @@ def _unasync_file(self, filepath):
8784
print(result, file=f, end="")
8885

8986
def _unasync_remove(self, contents, filename):
87+
from tokenize_rt import reversed_enumerate
88+
from tokenize_rt import src_to_tokens
89+
from tokenize_rt import tokens_to_src
90+
9091
tree = ast.parse(contents, filename=filename)
9192
tokens = src_to_tokens(contents)
9293
comment_lines_locations = []

0 commit comments

Comments
 (0)