mirror of
https://github.com/python/cpython.git
synced 2025-08-27 04:05:34 +00:00
gh-82626: Emit a warning when bool is used as a file descriptor (GH-111275)
This commit is contained in:
parent
09096a1647
commit
652fbf88c4
11 changed files with 75 additions and 0 deletions
|
@ -165,6 +165,12 @@ class GenericTest:
|
|||
os.close(w)
|
||||
self.assertFalse(self.pathmodule.exists(r))
|
||||
|
||||
def test_exists_bool(self):
|
||||
for fd in False, True:
|
||||
with self.assertWarnsRegex(RuntimeWarning,
|
||||
'bool is used as a file descriptor'):
|
||||
self.pathmodule.exists(fd)
|
||||
|
||||
def test_isdir(self):
|
||||
filename = os_helper.TESTFN
|
||||
bfilename = os.fsencode(filename)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue