diff options
author | Brett Cannon <brett@python.org> | 2016-09-07 02:36:01 (GMT) |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2016-09-07 02:36:01 (GMT) |
commit | a571120410bf7a92ca612068cf1a754d5dca614e (patch) | |
tree | 875c341f44dfbf0cc486c40170af17f300eead44 /Lib/test/test_compile.py | |
parent | a439191efa9fee12ea3c17b23b0d3f748ff76997 (diff) | |
download | cpython-a571120410bf7a92ca612068cf1a754d5dca614e.zip cpython-a571120410bf7a92ca612068cf1a754d5dca614e.tar.gz cpython-a571120410bf7a92ca612068cf1a754d5dca614e.tar.bz2 |
Issue #27182: Add support for path-like objects to PyUnicode_FSDecoder().
Diffstat (limited to 'Lib/test/test_compile.py')
-rw-r--r-- | Lib/test/test_compile.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index 9638e69..409ec86 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -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 |