mirror of
https://github.com/python/cpython.git
synced 2025-11-20 02:50:14 +00:00
Issue #8767: Restore building with --disable-unicode.
Original patch by Stefano Taschini.
This commit is contained in:
parent
77e77a1273
commit
ed11a5d018
14 changed files with 63 additions and 9 deletions
|
|
@ -405,7 +405,7 @@ def temp_cwd(name='tempcwd', quiet=False):
|
|||
the CWD, an error is raised. If it's True, only a warning is raised
|
||||
and the original CWD is used.
|
||||
"""
|
||||
if isinstance(name, unicode):
|
||||
if have_unicode and isinstance(name, unicode):
|
||||
try:
|
||||
name = name.encode(sys.getfilesystemencoding() or 'ascii')
|
||||
except UnicodeEncodeError:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue