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
af2362a5
Commit
af2362a5
authored
May 15, 2007
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make test_sys pass.
parent
7f21d306
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
+5
-6
Lib/subprocess.py
Lib/subprocess.py
+3
-4
Lib/test/test_sys.py
Lib/test/test_sys.py
+2
-2
No files found.
Lib/subprocess.py
View file @
af2362a5
...
@@ -287,7 +287,6 @@ import sys
...
@@ -287,7 +287,6 @@ import sys
mswindows
=
(
sys
.
platform
==
"win32"
)
mswindows
=
(
sys
.
platform
==
"win32"
)
import
os
import
os
import
types
import
traceback
import
traceback
# Exception classes used by this module.
# Exception classes used by this module.
...
@@ -700,7 +699,7 @@ class Popen(object):
...
@@ -700,7 +699,7 @@ class Popen(object):
errread
,
errwrite
):
errread
,
errwrite
):
"""Execute program (MS Windows version)"""
"""Execute program (MS Windows version)"""
if
not
isinstance
(
args
,
types
.
StringTypes
):
if
not
isinstance
(
args
,
basestring
):
args
=
list2cmdline
(
args
)
args
=
list2cmdline
(
args
)
# Process startup details
# Process startup details
...
@@ -917,7 +916,7 @@ class Popen(object):
...
@@ -917,7 +916,7 @@ class Popen(object):
errread
,
errwrite
):
errread
,
errwrite
):
"""Execute program (POSIX version)"""
"""Execute program (POSIX version)"""
if
isinstance
(
args
,
types
.
StringTypes
):
if
isinstance
(
args
,
basestring
):
args
=
[
args
]
args
=
[
args
]
else
:
else
:
args
=
list
(
args
)
args
=
list
(
args
)
...
@@ -1005,7 +1004,7 @@ class Popen(object):
...
@@ -1005,7 +1004,7 @@ class Popen(object):
# Wait for exec to fail or succeed; possibly raising exception
# Wait for exec to fail or succeed; possibly raising exception
data
=
os
.
read
(
errpipe_read
,
1048576
)
# Exceptions limited to 1 MB
data
=
os
.
read
(
errpipe_read
,
1048576
)
# Exceptions limited to 1 MB
os
.
close
(
errpipe_read
)
os
.
close
(
errpipe_read
)
if
data
!=
""
:
if
data
:
os
.
waitpid
(
self
.
pid
,
0
)
os
.
waitpid
(
self
.
pid
,
0
)
child_exception
=
pickle
.
loads
(
data
)
child_exception
=
pickle
.
loads
(
data
)
raise
child_exception
raise
child_exception
...
...
Lib/test/test_sys.py
View file @
af2362a5
...
@@ -174,7 +174,7 @@ class SysModuleTest(unittest.TestCase):
...
@@ -174,7 +174,7 @@ class SysModuleTest(unittest.TestCase):
if
test
.
test_support
.
have_unicode
:
if
test
.
test_support
.
have_unicode
:
self
.
assertRaises
(
TypeError
,
sys
.
getdefaultencoding
,
42
)
self
.
assertRaises
(
TypeError
,
sys
.
getdefaultencoding
,
42
)
# can't check more than the type, as the user might have changed it
# can't check more than the type, as the user might have changed it
self
.
assert_
(
isinstance
(
sys
.
getdefaultencoding
(),
str
))
self
.
assert_
(
isinstance
(
sys
.
getdefaultencoding
(),
basestring
))
# testing sys.settrace() is done in test_trace.py
# testing sys.settrace() is done in test_trace.py
# testing sys.setprofile() is done in test_profile.py
# testing sys.setprofile() is done in test_profile.py
...
@@ -349,7 +349,7 @@ class SysModuleTest(unittest.TestCase):
...
@@ -349,7 +349,7 @@ class SysModuleTest(unittest.TestCase):
def
test_intern
(
self
):
def
test_intern
(
self
):
self
.
assertRaises
(
TypeError
,
sys
.
intern
)
self
.
assertRaises
(
TypeError
,
sys
.
intern
)
s
=
"never interned before"
s
=
str8
(
"never interned before"
)
self
.
assert_
(
sys
.
intern
(
s
)
is
s
)
self
.
assert_
(
sys
.
intern
(
s
)
is
s
)
s2
=
s
.
swapcase
().
swapcase
()
s2
=
s
.
swapcase
().
swapcase
()
self
.
assert_
(
sys
.
intern
(
s2
)
is
s
)
self
.
assert_
(
sys
.
intern
(
s2
)
is
s
)
...
...
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