mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 05:54:25 +08:00
Make sith.py random work with files
This commit is contained in:
7
sith.py
7
sith.py
@@ -61,7 +61,9 @@ class SourceFinder(object):
|
||||
|
||||
@staticmethod
|
||||
def fetch(file_path):
|
||||
assert os.path.isdir(file_path), 'Path must be a directory, not a file.'
|
||||
if not os.path.isdir(file_path):
|
||||
yield file_path
|
||||
return
|
||||
for root, dirnames, filenames in os.walk(file_path):
|
||||
for name in filenames:
|
||||
if name.endswith('.py'):
|
||||
@@ -208,9 +210,6 @@ def main(arguments):
|
||||
int(arguments['<line>']), int(arguments['<column>'])
|
||||
).run(debugger, print_result=True)
|
||||
else:
|
||||
if not os.path.isdir(arguments['<path>']):
|
||||
print('Error: Path must be a directory, not a file.')
|
||||
sys.exit(1)
|
||||
for _ in range(int(arguments['--maxtries'])):
|
||||
t = TestCase.generate(arguments['<path>'] or '.')
|
||||
t.run(debugger, record)
|
||||
|
||||
Reference in New Issue
Block a user