Show More
@@ -44,7 +44,7 b' from IPython.utils import py3compat' | |||||
44 | from IPython.utils.io import capture_output |
|
44 | from IPython.utils.io import capture_output | |
45 | from IPython.utils.ipstruct import Struct |
|
45 | from IPython.utils.ipstruct import Struct | |
46 | from IPython.utils.module_paths import find_mod |
|
46 | from IPython.utils.module_paths import find_mod | |
47 |
from IPython.utils.path import get_py_filename, unquote_filename, glob |
|
47 | from IPython.utils.path import get_py_filename, unquote_filename, shellglob | |
48 | from IPython.utils.timing import clock, clock2 |
|
48 | from IPython.utils.timing import clock, clock2 | |
49 | from IPython.utils.warn import warn, error |
|
49 | from IPython.utils.warn import warn, error | |
50 |
|
50 | |||
@@ -499,7 +499,7 b' python-profiler package from non-free.""")' | |||||
499 | args = arg_lst[1:] |
|
499 | args = arg_lst[1:] | |
500 | else: |
|
500 | else: | |
501 | # tilde and glob expansion |
|
501 | # tilde and glob expansion | |
502 |
args = glob |
|
502 | args = shellglob(map(os.path.expanduser, arg_lst[1:])) | |
503 |
|
503 | |||
504 | sys.argv = [filename] + args # put in the proper filename |
|
504 | sys.argv = [filename] + args # put in the proper filename | |
505 | # protect sys.argv from potential unicode strings on Python 2: |
|
505 | # protect sys.argv from potential unicode strings on Python 2: |
@@ -356,7 +356,7 b' def expand_path(s):' | |||||
356 | return s |
|
356 | return s | |
357 |
|
357 | |||
358 |
|
358 | |||
359 |
def glob |
|
359 | def shellglob(args): | |
360 | """ |
|
360 | """ | |
361 | Do glob expansion for each element in `args` and return a flattened list. |
|
361 | Do glob expansion for each element in `args` and return a flattened list. | |
362 |
|
362 |
@@ -447,7 +447,7 b' def test_unicode_in_filename():' | |||||
447 | str(ex) |
|
447 | str(ex) | |
448 |
|
448 | |||
449 |
|
449 | |||
450 |
def test_glob |
|
450 | def test_shellglob(): | |
451 | """Test glob expansion for %run magic.""" |
|
451 | """Test glob expansion for %run magic.""" | |
452 | filenames_start_with_a = map('a{0}'.format, range(3)) |
|
452 | filenames_start_with_a = map('a{0}'.format, range(3)) | |
453 | filenames_end_with_b = map('{0}b'.format, range(3)) |
|
453 | filenames_end_with_b = map('{0}b'.format, range(3)) | |
@@ -464,7 +464,7 b' def test_globlist():' | |||||
464 |
|
464 | |||
465 | def assert_match(patterns, matches): |
|
465 | def assert_match(patterns, matches): | |
466 | # glob returns unordered list. that's why sorted is required. |
|
466 | # glob returns unordered list. that's why sorted is required. | |
467 |
nt.assert_equals(sorted(path.glob |
|
467 | nt.assert_equals(sorted(path.shellglob(patterns)), | |
468 | sorted(matches)) |
|
468 | sorted(matches)) | |
469 |
|
469 | |||
470 | assert_match(['*'], filenames) |
|
470 | assert_match(['*'], filenames) |
General Comments 0
You need to be logged in to leave comments.
Login now