mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 14:04:26 +08:00
Merge pull request #287 from davidhalter/sith_check_isfile
Sith check isfile
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -10,3 +10,4 @@
|
|||||||
/docs/_build/
|
/docs/_build/
|
||||||
/dist/
|
/dist/
|
||||||
jedi.egg-info/
|
jedi.egg-info/
|
||||||
|
record.json
|
||||||
|
|||||||
4
sith.py
4
sith.py
@@ -61,6 +61,7 @@ class SourceFinder(object):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def fetch(file_path):
|
def fetch(file_path):
|
||||||
|
assert os.path.isdir(file_path), 'Path must be a directory, not a file.'
|
||||||
for root, dirnames, filenames in os.walk(file_path):
|
for root, dirnames, filenames in os.walk(file_path):
|
||||||
for name in filenames:
|
for name in filenames:
|
||||||
if name.endswith('.py'):
|
if name.endswith('.py'):
|
||||||
@@ -207,6 +208,9 @@ def main(arguments):
|
|||||||
int(arguments['<line>']), int(arguments['<column>'])
|
int(arguments['<line>']), int(arguments['<column>'])
|
||||||
).run(debugger, print_result=True)
|
).run(debugger, print_result=True)
|
||||||
else:
|
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'])):
|
for _ in range(int(arguments['--maxtries'])):
|
||||||
t = TestCase.generate(arguments['<path>'] or '.')
|
t = TestCase.generate(arguments['<path>'] or '.')
|
||||||
t.run(debugger, record)
|
t.run(debugger, record)
|
||||||
|
|||||||
Reference in New Issue
Block a user