Author: Tyler Wade <[email protected]>
Branch: utf8-unicode2
Changeset: r72786:c5c9087c291c
Date: 2014-08-13 02:29 -0500
http://bitbucket.org/pypy/pypy/changeset/c5c9087c291c/
Log: More untranslated vs translated bools
diff --git a/pypy/objspace/std/newformat.py b/pypy/objspace/std/newformat.py
--- a/pypy/objspace/std/newformat.py
+++ b/pypy/objspace/std/newformat.py
@@ -462,7 +462,7 @@
self._precision = -1
spec = self.spec
- if not spec:
+ if (spec is None or not len(spec)):
return True
length = len(spec)
@@ -656,7 +656,7 @@
if self._fill_char == ord("0") and self._align == ord("="):
spec.n_min_width = self._width - extra_length
- if self._loc_thousands:
+ if self._loc_thousands is not None and len(self._loc_thousands):
self._group_digits(spec, digits[to_number:])
n_grouped_digits = len(self._grouped_digits)
else:
@@ -774,7 +774,7 @@
out.append_multiple_char(chr(fill_char), spec.n_spadding)
if spec.n_digits != 0:
- if self._loc_thousands:
+ if self._loc_thousands is not None and
len(self._loc_thousands):
if grouped_digits is not None:
digits = grouped_digits
else:
diff --git a/pypy/objspace/std/stringmethods.py
b/pypy/objspace/std/stringmethods.py
--- a/pypy/objspace/std/stringmethods.py
+++ b/pypy/objspace/std/stringmethods.py
@@ -447,7 +447,7 @@
sb = self._builder(prealloc_size)
for i in range(size):
- if value and i != 0:
+ if (value is not None and len(value)) and i != 0:
sb.append(value)
sb.append(unwrapped[i])
return self._new(sb.build())
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit