diff --git a/IPython/core/magics/execution.py b/IPython/core/magics/execution.py index 949e5e9..78e32c4 100644 --- a/IPython/core/magics/execution.py +++ b/IPython/core/magics/execution.py @@ -44,7 +44,7 @@ from IPython.utils import py3compat from IPython.utils.io import capture_output from IPython.utils.ipstruct import Struct from IPython.utils.module_paths import find_mod -from IPython.utils.path import get_py_filename, unquote_filename, globlist +from IPython.utils.path import get_py_filename, unquote_filename, shellglob from IPython.utils.timing import clock, clock2 from IPython.utils.warn import warn, error @@ -499,7 +499,7 @@ python-profiler package from non-free.""") args = arg_lst[1:] else: # tilde and glob expansion - args = globlist(map(os.path.expanduser, arg_lst[1:])) + args = shellglob(map(os.path.expanduser, arg_lst[1:])) sys.argv = [filename] + args # put in the proper filename # protect sys.argv from potential unicode strings on Python 2: diff --git a/IPython/utils/path.py b/IPython/utils/path.py index a9bc501..95d05ef 100644 --- a/IPython/utils/path.py +++ b/IPython/utils/path.py @@ -356,7 +356,7 @@ def expand_path(s): return s -def globlist(args): +def shellglob(args): """ Do glob expansion for each element in `args` and return a flattened list. diff --git a/IPython/utils/tests/test_path.py b/IPython/utils/tests/test_path.py index 36a6203..71a2896 100644 --- a/IPython/utils/tests/test_path.py +++ b/IPython/utils/tests/test_path.py @@ -447,7 +447,7 @@ def test_unicode_in_filename(): str(ex) -def test_globlist(): +def test_shellglob(): """Test glob expansion for %run magic.""" filenames_start_with_a = map('a{0}'.format, range(3)) filenames_end_with_b = map('{0}b'.format, range(3)) @@ -464,7 +464,7 @@ def test_globlist(): def assert_match(patterns, matches): # glob returns unordered list. that's why sorted is required. - nt.assert_equals(sorted(path.globlist(patterns)), + nt.assert_equals(sorted(path.shellglob(patterns)), sorted(matches)) assert_match(['*'], filenames)