Skip to content

Commit 9e2c8e6

Browse files
authored
Resolve TODO after LibCST PR 994 (#12)
1 parent 9872f7f commit 9e2c8e6

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

torchfix/__main__.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import contextlib
55
import sys
66
import io
7-
import os
87

98
from .torchfix import TorchCodemod, TorchCodemodConfig
109
from .common import CYAN, ENDC
@@ -55,13 +54,11 @@ def main() -> None:
5554
MARKER = "torch" # this will catch import torch or functorch
5655
torch_files = []
5756
for file in files:
58-
# TODO: remove the check when https://github.com/Instagram/LibCST/pull/994 lands
59-
if os.path.isfile(file): # `codemod.gather_files` can return dirs with ".py"
60-
with open(file, errors="replace") as f:
61-
for line in f:
62-
if MARKER in line:
63-
torch_files.append(file)
64-
break
57+
with open(file, errors="replace") as f:
58+
for line in f:
59+
if MARKER in line:
60+
torch_files.append(file)
61+
break
6562

6663
config = TorchCodemodConfig()
6764
config.select = args.select

0 commit comments

Comments
 (0)