Skip to content

Commit

Permalink
Merge pull request #1660 from aucampia/iwana-20220110T2208-remove_narrow
Browse files Browse the repository at this point in the history
Remove narrow build detection
  • Loading branch information
nicholascar committed Jan 12, 2022
2 parents d957533 + fece4a5 commit a6c5169
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 36 deletions.
23 changes: 0 additions & 23 deletions rdflib/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import re
import codecs
import warnings
import typing as t

if t.TYPE_CHECKING:
Expand Down Expand Up @@ -59,28 +58,6 @@ def _unicodeExpand(s):
return r_unicodeEscape.sub(lambda m: chr(int(m.group(0)[2:], 16)), s)


narrow_build = False
try:
chr(0x10FFFF)
except ValueError:
narrow_build = True

if narrow_build:

def _unicodeExpand(s):
try:
return r_unicodeEscape.sub(lambda m: chr(int(m.group(0)[2:], 16)), s)
except ValueError:
warnings.warn(
"Encountered a unicode char > 0xFFFF in a narrow python build. "
"Trying to degrade gracefully, but this can cause problems "
"later when working with the string:\n%s" % s
)
return r_unicodeEscape.sub(
lambda m: codecs.decode(m.group(0), "unicode_escape"), s
)


def decodeStringEscape(s):
r"""
s is byte-string - replace \ escapes in string
Expand Down
13 changes: 0 additions & 13 deletions test/test_wide_python.py

This file was deleted.

0 comments on commit a6c5169

Please sign in to comment.