mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
* string.py: added rindex(), rfind(); changed index() to interpret
negative start indices starting from the right. * ftplib.py: debug() -> set_debuglevel(); change demo to use __init__(). * os.py: added execl, execlp, and execvp. * lambda.py: removed (now that we have built-in map, reduce, bagof, lambda) * test_b{1,2}.py, testall.out: added tests for bagof, lambda, map, reduce * commands.py: use os, not posix * test_grammar.py: make it easy to disable non-portable int overflow tests * dis.py: don't abuse range()
This commit is contained in:
parent
db65a6ce55
commit
e65cce5eec
10 changed files with 161 additions and 20 deletions
|
@ -23,8 +23,8 @@ def getoutput(cmd):
|
|||
# Returns a pair (sts, output)
|
||||
#
|
||||
def getstatusoutput(cmd):
|
||||
import posix
|
||||
pipe = posix.popen('{ ' + cmd + '; } 2>&1', 'r')
|
||||
import os
|
||||
pipe = os.popen('{ ' + cmd + '; } 2>&1', 'r')
|
||||
text = pipe.read()
|
||||
sts = pipe.close()
|
||||
if sts == None: sts = 0
|
||||
|
@ -35,8 +35,8 @@ def getstatusoutput(cmd):
|
|||
# Make command argument from directory and pathname (prefix space, add quotes).
|
||||
#
|
||||
def mk2arg(head, x):
|
||||
import posixpath
|
||||
return mkarg(posixpath.join(head, x))
|
||||
import os
|
||||
return mkarg(os.path.join(head, x))
|
||||
|
||||
|
||||
# Make a shell command argument from a string.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue