Skip to content

Commit dab1afd

Browse files
committed
fix python long type in report tool #76
1 parent ad224a4 commit dab1afd

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

mamonsu/lib/platform.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@
77

88
PY2 = (sys.version_info[0] == 2)
99
PY3 = (sys.version_info[0] == 3)
10+
11+
if PY2:
12+
INTEGER_TYPES = (int, long)
13+
if PY3:
14+
INTEGER_TYPES = int

mamonsu/tools/report/format.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import re
44
import sys
5+
import mamonsu.lib.platform as platform
56

67

78
class color(object):
@@ -34,7 +35,7 @@ def __getattr__(self, name):
3435
# int (bytes) => str (human readable)
3536
def humansize_bytes(nbytes):
3637
fmt = '{0:>6} {1}'
37-
if not isinstance(nbytes, int):
38+
if not isinstance(nbytes, platform.INTEGER_TYPES):
3839
return 'ERROR'
3940
if nbytes == 0:
4041
return fmt.format(0, 'B')

0 commit comments

Comments
 (0)