Author: Armin Rigo <ar...@tunes.org> Branch: Changeset: r78711:81b300c1d878 Date: 2015-07-26 19:42 +0200 http://bitbucket.org/pypy/pypy/changeset/81b300c1d878/
Log: If unicodedata_handler happens to be None here, don't interpret \N sequences at all (grafted from 522b1566ead2b0fbdbe6952232268a07ad39eb3b) diff --git a/rpython/rlib/runicode.py b/rpython/rlib/runicode.py --- a/rpython/rlib/runicode.py +++ b/rpython/rlib/runicode.py @@ -1275,16 +1275,9 @@ "unicodeescape", errorhandler, message, errors) # \N{name} - elif ch == 'N': + elif ch == 'N' and unicodedata_handler is not None: message = "malformed \\N character escape" look = pos - if unicodedata_handler is None: - message = ("\\N escapes not supported " - "(can't load unicodedata module)") - res, pos = errorhandler(errors, "unicodeescape", - message, s, pos-1, size) - builder.append(res) - continue if look < size and s[look] == '{': # look for the closing brace _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit