Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
030afb1d
Commit
030afb1d
authored
Mar 14, 1995
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add execvpe -- mix of execvp and execve
parent
dcce73af
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
6 deletions
+22
-6
Lib/os.py
Lib/os.py
+22
-6
No files found.
Lib/os.py
View file @
030afb1d
...
...
@@ -55,16 +55,32 @@ def execle(file, *args):
def
execlp
(
file
,
*
args
):
execvp
(
file
,
args
)
_notfound
=
None
def
execlpe
(
file
,
*
args
):
env
=
args
[
-
1
]
execvpe
(
file
,
args
[:
-
1
],
env
)
def
execvp
(
file
,
args
):
_execvpe
(
file
,
args
)
def
execvpe
(
file
,
args
,
env
):
_execvpe
(
file
,
args
,
env
)
_notfound
=
None
def
_execvpe
(
file
,
args
,
env
=
None
):
if
env
:
func
=
execve
argrest
=
(
args
,
env
)
else
:
func
=
execv
argrest
=
(
args
,)
env
=
environ
global
_notfound
head
,
tail
=
path
.
split
(
file
)
if
head
:
execv
(
file
,
args
)
apply
(
func
,
(
file
,)
+
argrest
)
return
ENOENT
=
2
if
environ
.
has_key
(
'PATH'
):
envpath
=
environ
[
'PATH'
]
if
env
.
has_key
(
'PATH'
):
envpath
=
env
[
'PATH'
]
else
:
envpath
=
defpath
import
string
...
...
@@ -78,7 +94,7 @@ def execvp(file, args):
for
dir
in
PATH
:
fullname
=
path
.
join
(
dir
,
file
)
try
:
execv
(
fullname
,
args
)
apply
(
func
,
(
fullname
,)
+
argrest
)
except
error
,
(
errno
,
msg
):
if
errno
!=
arg
[
0
]:
exc
,
arg
=
error
,
(
errno
,
msg
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment