##// END OF EJS Templates
added extra warning for windows %run
kory donati -
Show More
@@ -646,7 +646,9 b' python-profiler package from non-free.""")'
646 return
646 return
647 arg_lst = [modpath] + arg_lst
647 arg_lst = [modpath] + arg_lst
648 try:
648 try:
649 filename = file_finder(arg_lst[0])
649 fpath = None # initialize to make sure fpath is in scope later
650 fpath = arg_lst[0]
651 filename = file_finder(fpath)
650 except IndexError:
652 except IndexError:
651 warn('you must provide at least a filename.')
653 warn('you must provide at least a filename.')
652 print('\n%run:\n', oinspect.getdoc(self.run))
654 print('\n%run:\n', oinspect.getdoc(self.run))
@@ -656,6 +658,9 b' python-profiler package from non-free.""")'
656 msg = str(e)
658 msg = str(e)
657 except UnicodeError:
659 except UnicodeError:
658 msg = e.message
660 msg = e.message
661 import re
662 if os.name == 'nt' and re.match(r"^'.*'$",fpath):
663 warn('For Windows, use double quotes to wrap a filename: %run "mypath\\myfile.py"')
659 error(msg)
664 error(msg)
660 return
665 return
661
666
General Comments 0
You need to be logged in to leave comments. Login now