[pypy-commit] pypy py3.6: Fix confusing variable naming

rlamy pypy.commits at gmail.com
Thu Sep 19 11:04:13 EDT 2019


Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: py3.6
Changeset: r97540:90d95ff4347e
Date: 2019-09-19 16:03 +0100
http://bitbucket.org/pypy/pypy/changeset/90d95ff4347e/

Log:	Fix confusing variable naming

diff --git a/pypy/interpreter/unicodehelper.py b/pypy/interpreter/unicodehelper.py
--- a/pypy/interpreter/unicodehelper.py
+++ b/pypy/interpreter/unicodehelper.py
@@ -125,12 +125,12 @@
     from pypy.module._codecs import interp_codecs
     state = space.fromcache(interp_codecs.CodecState)
     unicodedata_handler = state.get_unicodedata_handler(space)
-    s, blen, ulen, first_escape_error_char = str_decode_unicode_escape(
+    s, ulen, blen, first_escape_error_char = str_decode_unicode_escape(
         string, "strict",
         final=True,
         errorhandler=state.decode_error_handler,
         ud_handler=unicodedata_handler)
-    return s, blen, ulen
+    return s, ulen, blen
 
 def decode_raw_unicode_escape(space, string):
     return str_decode_raw_unicode_escape(
diff --git a/pypy/module/_codecs/interp_codecs.py b/pypy/module/_codecs/interp_codecs.py
--- a/pypy/module/_codecs/interp_codecs.py
+++ b/pypy/module/_codecs/interp_codecs.py
@@ -733,8 +733,6 @@
 @unwrap_spec(string='bufferstr', errors='text_or_none',
              w_final = WrappedDefault(False))
 def utf_8_decode(space, string, errors="strict", w_final=None):
-
-
     if errors is None:
         errors = 'strict'
     final = space.is_true(w_final)
@@ -874,8 +872,6 @@
 
 @unwrap_spec(string='bufferstr', errors='text_or_none')
 def charmap_decode(space, string, errors="strict", w_mapping=None):
-
-
     if errors is None:
         errors = 'strict'
     if len(string) == 0:
@@ -896,7 +892,6 @@
 
 @unwrap_spec(errors='text_or_none')
 def charmap_encode(space, w_unicode, errors="strict", w_mapping=None):
-
     if errors is None:
         errors = 'strict'
     if space.is_none(w_mapping):
@@ -954,7 +949,7 @@
 
     unicode_name_handler = state.get_unicodedata_handler(space)
 
-    result, lgt, u_len, first_escape_error_char = unicodehelper.str_decode_unicode_escape(
+    result, u_len, lgt, first_escape_error_char = unicodehelper.str_decode_unicode_escape(
         string, errors,
         final, state.decode_error_handler,
         unicode_name_handler)
@@ -973,7 +968,7 @@
             space.newtext(msg),
             space.w_DeprecationWarning
         )
-    return space.newtuple([space.newutf8(result, lgt), space.newint(u_len)])
+    return space.newtuple([space.newutf8(result, u_len), space.newint(lgt)])
 
 # ____________________________________________________________
 # Raw Unicode escape (accepts bytes or str)
@@ -994,8 +989,6 @@
 
 @unwrap_spec(errors='text_or_none')
 def unicode_internal_decode(space, w_string, errors="strict"):
-
-
     if errors is None:
         errors = 'strict'
     # special case for this codec: unicodes are returned as is


More information about the pypy-commit mailing list