mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Issue #27182: Add support for path-like objects to PyUnicode_FSDecoder().
This commit is contained in:
parent
a439191efa
commit
a571120410
5 changed files with 72 additions and 30 deletions
|
@ -664,6 +664,16 @@ if 1:
|
|||
self.assertTrue(f1(0))
|
||||
self.assertTrue(f2(0.0))
|
||||
|
||||
def test_path_like_objects(self):
|
||||
# An implicit test for PyUnicode_FSDecoder().
|
||||
class PathLike:
|
||||
def __init__(self, path):
|
||||
self._path = path
|
||||
def __fspath__(self):
|
||||
return self._path
|
||||
|
||||
compile("42", PathLike("test_compile_pathlike"), "single")
|
||||
|
||||
|
||||
class TestStackSize(unittest.TestCase):
|
||||
# These tests check that the computed stack size for a code object
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue