Commits

Konstantin Lopuhin committed 3026da3

use int formatter for bool, cause it already calls str if spec is empty

  • Participants
  • Parent commits 0cee279

Comments (0)

Files changed (2)

File pypy/objspace/std/boolobject.py

 
 def format__Bool_ANY(space, w_bool, w_format_spec):
     return newformat.run_formatter(
-            space, w_format_spec, "format_bool", w_bool)
+            space, w_format_spec, "format_int_or_long", w_bool,
+            newformat.INT_KIND)
 
 register_all(vars())

File pypy/objspace/std/newformat.py

                 buf[i] = "-"
             assert i >= 0
             return self.empty.join(buf[i:])
-        
-        def format_bool(self, w_bool):
-            if self.spec:
-                return self.format_int_or_long(w_bool, INT_KIND) 
-            else:
-                return self.space.str(w_bool)
 
         def format_int_or_long(self, w_num, kind):
             space = self.space