[pypy-commit] pypy stdlib-2.7.5: Remove redundant test for NULL; emulate behavior of CPython 2.7 by only raising an error for control characters < 0x20.

chrish42 noreply at buildbot.pypy.org
Mon Oct 7 09:09:08 CEST 2013


Author: Christian Hudon <chrish at pianocktail.org>
Branch: stdlib-2.7.5
Changeset: r67171:1307a5424887
Date: 2013-10-06 17:31 -0400
http://bitbucket.org/pypy/pypy/changeset/1307a5424887/

Log:	Remove redundant test for NULL; emulate behavior of CPython 2.7 by
	only raising an error for control characters < 0x20.

diff --git a/pypy/module/_pypyjson/interp_decoder.py b/pypy/module/_pypyjson/interp_decoder.py
--- a/pypy/module/_pypyjson/interp_decoder.py
+++ b/pypy/module/_pypyjson/interp_decoder.py
@@ -315,9 +315,7 @@
                 content_so_far = self.getslice(start, i-1)
                 self.pos = i-1
                 return self.decode_string_escaped(start, content_so_far)
-            elif ch == '\0':
-                self._raise("Unterminated string starting at char %d", start)
-            elif ch < '\x20' or ch == '\x7f':
+            elif ch < '\x20':
                 self._raise("Invalid control character at char %d", self.pos-1)
 
 


More information about the pypy-commit mailing list