Browse Source

Fix bugs in support for old Pythons

Clara Hobbs 7 years ago
parent
commit
28d9667955
1 changed files with 5 additions and 5 deletions
  1. 5
    5
      pdbuddy/__init__.py

+ 5
- 5
pdbuddy/__init__.py View File

7
     import enum
7
     import enum
8
     # Make sure Flag is available
8
     # Make sure Flag is available
9
     enum.Flag
9
     enum.Flag
10
-except (ImportError, NameError):
10
+except (ImportError, NameError, AttributeError):
11
     # If something above failed, try aenum instead
11
     # If something above failed, try aenum instead
12
     import aenum as enum
12
     import aenum as enum
13
 
13
 
245
             s += "\n"
245
             s += "\n"
246
 
246
 
247
         if self.v is not None:
247
         if self.v is not None:
248
-            s += "v: {:.2f} V\n".format(self.v / 1000)
248
+            s += "v: {:.2f} V\n".format(self.v / 1000.0)
249
 
249
 
250
         if self.i is not None:
250
         if self.i is not None:
251
-            s += "i: {:.2f} A\n".format(self.i / 1000)
251
+            s += "i: {:.2f} A\n".format(self.i / 1000.0)
252
 
252
 
253
         # Return all but the last character of s to remove the trailing newline
253
         # Return all but the last character of s to remove the trailing newline
254
         if s:
254
         if s:
375
         if self.peak_i:
375
         if self.peak_i:
376
             s += "\tpeak_i: {}\n".format(self.peak_i)
376
             s += "\tpeak_i: {}\n".format(self.peak_i)
377
 
377
 
378
-        s += "\tv: {:.2f} V\n".format(self.v / 1000)
379
-        s += "\ti: {:.2f} A".format(self.i / 1000)
378
+        s += "\tv: {:.2f} V\n".format(self.v / 1000.0)
379
+        s += "\ti: {:.2f} A".format(self.i / 1000.0)
380
 
380
 
381
         return s
381
         return s
382
 
382
 

Loading…
Cancel
Save