##// END OF EJS Templates
Merge pull request #4631 from takluyver/i4629...
Min RK -
r13770:f79049c4 merge
parent child Browse files
Show More
@@ -425,7 +425,7 b' def monkeypatch(obj, name, attr):'
425
425
426 def help_output_test(subcommand=''):
426 def help_output_test(subcommand=''):
427 """test that `ipython [subcommand] -h` works"""
427 """test that `ipython [subcommand] -h` works"""
428 cmd = ' '.join(get_ipython_cmd() + [subcommand, '-h'])
428 cmd = get_ipython_cmd() + [subcommand, '-h']
429 out, err, rc = get_output_error_code(cmd)
429 out, err, rc = get_output_error_code(cmd)
430 nt.assert_equal(rc, 0, err)
430 nt.assert_equal(rc, 0, err)
431 nt.assert_not_in("Traceback", err)
431 nt.assert_not_in("Traceback", err)
@@ -436,7 +436,7 b" def help_output_test(subcommand=''):"
436
436
437 def help_all_output_test(subcommand=''):
437 def help_all_output_test(subcommand=''):
438 """test that `ipython [subcommand] --help-all` works"""
438 """test that `ipython [subcommand] --help-all` works"""
439 cmd = ' '.join(get_ipython_cmd() + [subcommand, '--help-all'])
439 cmd = get_ipython_cmd() + [subcommand, '--help-all']
440 out, err, rc = get_output_error_code(cmd)
440 out, err, rc = get_output_error_code(cmd)
441 nt.assert_equal(rc, 0, err)
441 nt.assert_equal(rc, 0, err)
442 nt.assert_not_in("Traceback", err)
442 nt.assert_not_in("Traceback", err)
@@ -47,9 +47,10 b' def process_handler(cmd, callback, stderr=subprocess.PIPE):'
47
47
48 Parameters
48 Parameters
49 ----------
49 ----------
50 cmd : str
50 cmd : str or list
51 A string to be executed with the underlying system shell (by calling
51 A command to be executed by the system, using :class:`subprocess.Popen`.
52 :func:`Popen` with ``shell=True``.
52 If a string is passed, it will be run in the system shell. If a list is
53 passed, it will be used directly as arguments.
53
54
54 callback : callable
55 callback : callable
55 A one-argument function that will be called with the Popen object.
56 A one-argument function that will be called with the Popen object.
@@ -68,7 +69,7 b' def process_handler(cmd, callback, stderr=subprocess.PIPE):'
68 sys.stderr.flush()
69 sys.stderr.flush()
69 # On win32, close_fds can't be true when using pipes for stdin/out/err
70 # On win32, close_fds can't be true when using pipes for stdin/out/err
70 close_fds = sys.platform != 'win32'
71 close_fds = sys.platform != 'win32'
71 p = subprocess.Popen(cmd, shell=True,
72 p = subprocess.Popen(cmd, shell=isinstance(cmd, py3compat.string_types),
72 stdin=subprocess.PIPE,
73 stdin=subprocess.PIPE,
73 stdout=subprocess.PIPE,
74 stdout=subprocess.PIPE,
74 stderr=stderr,
75 stderr=stderr,
@@ -107,7 +108,7 b' def getoutput(cmd):'
107
108
108 Parameters
109 Parameters
109 ----------
110 ----------
110 cmd : str
111 cmd : str or list
111 A command to be executed in the system shell.
112 A command to be executed in the system shell.
112
113
113 Returns
114 Returns
@@ -131,7 +132,7 b' def getoutputerror(cmd):'
131
132
132 Parameters
133 Parameters
133 ----------
134 ----------
134 cmd : str
135 cmd : str or list
135 A command to be executed in the system shell.
136 A command to be executed in the system shell.
136
137
137 Returns
138 Returns
@@ -149,7 +150,7 b' def get_output_error_code(cmd):'
149
150
150 Parameters
151 Parameters
151 ----------
152 ----------
152 cmd : str
153 cmd : str or list
153 A command to be executed in the system shell.
154 A command to be executed in the system shell.
154
155
155 Returns
156 Returns
@@ -112,7 +112,7 b' def system(cmd):'
112
112
113 Parameters
113 Parameters
114 ----------
114 ----------
115 cmd : str
115 cmd : str or list
116 A command to be executed in the system shell.
116 A command to be executed in the system shell.
117
117
118 Returns
118 Returns
@@ -138,7 +138,7 b' def getoutput(cmd):'
138
138
139 Parameters
139 Parameters
140 ----------
140 ----------
141 cmd : str
141 cmd : str or list
142 A command to be executed in the system shell.
142 A command to be executed in the system shell.
143
143
144 Returns
144 Returns
General Comments 0
You need to be logged in to leave comments. Login now