Show More
@@ -16,6 +16,7 b' import sys' | |||||
16 | import time |
|
16 | import time | |
17 | import timeit |
|
17 | import timeit | |
18 | import math |
|
18 | import math | |
|
19 | import re | |||
19 | from pdb import Restart |
|
20 | from pdb import Restart | |
20 |
|
21 | |||
21 | # cProfile was added in Python2.5 |
|
22 | # cProfile was added in Python2.5 | |
@@ -646,7 +647,9 b' python-profiler package from non-free.""")' | |||||
646 | return |
|
647 | return | |
647 | arg_lst = [modpath] + arg_lst |
|
648 | arg_lst = [modpath] + arg_lst | |
648 | try: |
|
649 | try: | |
649 | filename = file_finder(arg_lst[0]) |
|
650 | fpath = None # initialize to make sure fpath is in scope later | |
|
651 | fpath = arg_lst[0] | |||
|
652 | filename = file_finder(fpath) | |||
650 | except IndexError: |
|
653 | except IndexError: | |
651 | warn('you must provide at least a filename.') |
|
654 | warn('you must provide at least a filename.') | |
652 | print('\n%run:\n', oinspect.getdoc(self.run)) |
|
655 | print('\n%run:\n', oinspect.getdoc(self.run)) | |
@@ -656,6 +659,8 b' python-profiler package from non-free.""")' | |||||
656 | msg = str(e) |
|
659 | msg = str(e) | |
657 | except UnicodeError: |
|
660 | except UnicodeError: | |
658 | msg = e.message |
|
661 | msg = e.message | |
|
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