Quellcode durchsuchen

Convert to Python 3: clarify print() syntax

Not sure why but 2to3 suggested to enclose the % expression into
parentheses before passing it to print(); I did about the same thing
manually but a bit more readable.
Alois Mahdal vor 2 Jahren
Ursprung
Commit
73ffafa606
1 geänderte Dateien mit 5 neuen und 4 gelöschten Zeilen
  1. 5
    4
      sznqalibs/bottleneck.py

+ 5
- 4
sznqalibs/bottleneck.py Datei anzeigen

@@ -36,10 +36,11 @@ class FrameState(object):
36 36
 
37 37
     def debug(self):
38 38
         if self.DEBUG_MODE:
39
-            print("%4d; %4d; %5s; %0.3f; %0.3f; %5s; %5s"
40
-                  % (self.load, self.MAX_LOAD, self.load_ok,
41
-                     self.pos, self.SIZE, self.time_ok,
42
-                     self.allows))
39
+            msg = ("%4d; %4d; %5s; %0.3f; %0.3f; %5s; %5s"
40
+                   % (self.load, self.MAX_LOAD, self.load_ok,
41
+                      self.pos, self.SIZE, self.time_ok,
42
+                      self.allows))
43
+            print(msg)
43 44
 
44 45
     def is_closed(self):
45 46
         return not self.is_open()