Skip to content

Commit bc70341

Browse files
Oliver SchoenbornOliver Schoenborn
authored andcommitted
fixes #12
1 parent 07a0cf3 commit bc70341

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

nose2pytest/script.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
from lib2to3 import refactor, fixer_base, pygram, pytree, pgen2
2222
from lib2to3.pytree import Node as PyNode, Leaf as PyLeaf
2323
from lib2to3.pgen2 import token
24+
from pathlib import Path
25+
2426
from lib2to3.fixer_util import parenthesize
2527

2628
__version__ = "1.0.9"
@@ -629,6 +631,7 @@ def get_fixers(self):
629631

630632
return pre_fixers, post_fixers
631633

634+
632635
def setup():
633636
# from nose import tools as nosetools
634637
# import inspect
@@ -652,6 +655,10 @@ def setup():
652655

653656
def main():
654657
args = setup()
658+
if not Path(args.dir_name).exists():
659+
print('ERROR: Path "%s" does not exist' % args.dir_name, file=sys.stderr)
660+
sys.exit(1)
661+
655662
refac = NoseConversionRefactoringTool(args.verbose)
656663
refac.refactor_dir(args.dir_name, write=args.write)
657664

0 commit comments

Comments
 (0)