mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Fixed bug #1915: Python compiles with --enable-unicode=no again. However several extension methods and modules do not work without unicode support.
This commit is contained in:
parent
964ca4274f
commit
082c9b0267
4 changed files with 12 additions and 4 deletions
|
@ -30,6 +30,7 @@ Written by Marc-Andre Lemburg (mal@lemburg.com).
|
|||
|
||||
import codecs
|
||||
from encodings import aliases
|
||||
import __builtin__
|
||||
|
||||
_cache = {}
|
||||
_unknown = '--unknown--'
|
||||
|
@ -60,7 +61,7 @@ def normalize_encoding(encoding):
|
|||
"""
|
||||
# Make sure we have an 8-bit string, because .translate() works
|
||||
# differently for Unicode strings.
|
||||
if isinstance(encoding, unicode):
|
||||
if hasattr(__builtin__, "unicode") and isinstance(encoding, unicode):
|
||||
# Note that .encode('latin-1') does *not* use the codec
|
||||
# registry, so this call doesn't recurse. (See unicodeobject.c
|
||||
# PyUnicode_AsEncodedString() for details)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue