mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Merged revisions 68779 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r68779 | benjamin.peterson | 2009-01-19 11:37:42 -0600 (Mon, 19 Jan 2009) | 1 line make bad file descriptor tests more robust ........
This commit is contained in:
parent
9053d75485
commit
7522c748b1
3 changed files with 32 additions and 15 deletions
|
@ -344,6 +344,18 @@ def sortdict(dict):
|
|||
withcommas = ", ".join(reprpairs)
|
||||
return "{%s}" % withcommas
|
||||
|
||||
def make_bad_fd():
|
||||
"""
|
||||
Create an invalid file descriptor by opening and closing a file and return
|
||||
its fd.
|
||||
"""
|
||||
file = open(TESTFN, "wb")
|
||||
try:
|
||||
return file.fileno()
|
||||
finally:
|
||||
file.close()
|
||||
unlink(TESTFN)
|
||||
|
||||
def check_syntax_error(testcase, statement):
|
||||
try:
|
||||
compile(statement, '<test string>', 'exec')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue