[pypy-svn] r13874 - pypy/branch/pypy-translation-snapshot/objspace/std
arigo at codespeak.net
arigo at codespeak.net
Sat Jun 25 18:11:08 CEST 2005
Author: arigo
Date: Sat Jun 25 18:11:08 2005
New Revision: 13874
Modified:
pypy/branch/pypy-translation-snapshot/objspace/std/stringobject.py
Log:
Port to pypy-translation-snapshot of rev 13873.
Modified: pypy/branch/pypy-translation-snapshot/objspace/std/stringobject.py
==============================================================================
--- pypy/branch/pypy-translation-snapshot/objspace/std/stringobject.py (original)
+++ pypy/branch/pypy-translation-snapshot/objspace/std/stringobject.py Sat Jun 25 18:11:08 2005
@@ -348,10 +348,10 @@
if len(fillchar) != 1:
raise OperationError(space.w_TypeError,
space.wrap("rjust() argument 2 must be a single character"))
-
d = u_arg - len(u_self)
if d>0:
+ fillchar = fillchar[0] # annotator hint: it's a single character
u_self = d * fillchar + u_self
return space.wrap(u_self)
@@ -368,6 +368,7 @@
d = u_arg - len(u_self)
if d>0:
+ fillchar = fillchar[0] # annotator hint: it's a single character
u_self += d * fillchar
return space.wrap(u_self)
@@ -585,6 +586,7 @@
d = u_arg - len(u_self)
if d>0:
offset = d//2
+ fillchar = fillchar[0] # annotator hint: it's a single character
u_centered = offset * fillchar + u_self + (d - offset) * fillchar
else:
u_centered = u_self
More information about the Pypy-commit
mailing list