[Jython-checkins] jython: Don't overwrite alignment and fill char in format spec.

nicholas.riley jython-checkins at python.org
Wed Mar 21 21:34:58 CET 2012


http://hg.python.org/jython/rev/baf6e4ab0cef
changeset:   6460:baf6e4ab0cef
user:        Nicholas Riley <njriley at illinois.edu>
date:        Wed Mar 21 16:25:15 2012 -0400
summary:
  Don't overwrite alignment and fill char in format spec.

files:
  src/org/python/core/stringlib/InternalFormatSpecParser.java |  5 +++--
  1 files changed, 3 insertions(+), 2 deletions(-)


diff --git a/src/org/python/core/stringlib/InternalFormatSpecParser.java b/src/org/python/core/stringlib/InternalFormatSpecParser.java
--- a/src/org/python/core/stringlib/InternalFormatSpecParser.java
+++ b/src/org/python/core/stringlib/InternalFormatSpecParser.java
@@ -42,9 +42,10 @@
             result.alternate = true;
             index++;
         }
-        if (isAt("0")) {
-            result.align = '=';
+        if (result.fill_char == '\0' && isAt("0")) {
             result.fill_char = '0';
+            if (result.align == '\0')
+                result.align = '=';
             index++;
         }
         result.width = getInteger();

-- 
Repository URL: http://hg.python.org/jython


More information about the Jython-checkins mailing list