[pypy-commit] pypy py3.3: simplify

pjenvey noreply at buildbot.pypy.org
Sun Jul 27 20:40:07 CEST 2014


Author: Philip Jenvey <pjenvey at underboss.org>
Branch: py3.3
Changeset: r72576:504023330351
Date: 2014-07-27 11:36 -0700
http://bitbucket.org/pypy/pypy/changeset/504023330351/

Log:	simplify

diff --git a/pypy/module/operator/tscmp.py b/pypy/module/operator/tscmp.py
--- a/pypy/module/operator/tscmp.py
+++ b/pypy/module/operator/tscmp.py
@@ -31,17 +31,15 @@
     if (space.isinstance_w(w_a, space.w_unicode) and
         space.isinstance_w(w_b, space.w_unicode)):
         try:
-            a_value = space.call_method(w_a, "encode", space.wrap("ascii"))
-            b_value = space.call_method(w_b, "encode", space.wrap("ascii"))
-            return compare_digest_buffer(space, a_value, b_value)
+            w_a = space.call_method(w_a, 'encode', space.wrap('ascii'))
+            w_b = space.call_method(w_b, 'encode', space.wrap('ascii'))
         except OperationError as e:
             if not e.match(space, space.w_UnicodeEncodeError):
                 raise
             raise oefmt(space.w_TypeError,
                         "comparing strings with non-ASCII characters is not "
                         "supported")
-    else:
-        return compare_digest_buffer(space, w_a, w_b)
+    return compare_digest_buffer(space, w_a, w_b)
 
 
 def compare_digest_buffer(space, w_a, w_b):


More information about the pypy-commit mailing list