From 1762cb2ef84d7d3dcc96deedbe2e3c2a1c10e8b5 Mon Sep 17 00:00:00 2001 From: Danilo Bargen Date: Fri, 9 Aug 2013 13:28:01 +0200 Subject: [PATCH 1/2] Added record.json to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 4755f455..b4fce685 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ /docs/_build/ /dist/ jedi.egg-info/ +record.json From 78061199119c1c72da383bff49c55114c6d804db Mon Sep 17 00:00:00 2001 From: Danilo Bargen Date: Fri, 9 Aug 2013 13:32:43 +0200 Subject: [PATCH 2/2] Verify that path in "random" operation is a directory --- sith.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sith.py b/sith.py index 9e15a42d..27e1c483 100755 --- a/sith.py +++ b/sith.py @@ -61,6 +61,7 @@ class SourceFinder(object): @staticmethod 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 name in filenames: if name.endswith('.py'): @@ -202,6 +203,9 @@ def main(arguments): int(arguments['']), int(arguments['']) ).run(debugger, print_result=True) else: + if not os.path.isdir(arguments['']): + print('Error: Path must be a directory, not a file.') + sys.exit(1) for _ in range(int(arguments['--maxtries'])): t = TestCase.generate(arguments[''] or '.') t.run(debugger, record)