2017-12-07 18:12:07 +01:00
|
|
|
From 955c4f03d623461c4e06d9f39eea7ac305104b0a Mon Sep 17 00:00:00 2001
|
|
|
|
From: Martin Wilck <mwilck@suse.com>
|
|
|
|
Date: Thu, 7 Dec 2017 11:21:21 +0100
|
|
|
|
Subject: [PATCH 3/4] virtinst: python3: avoid using long type
|
|
|
|
|
|
|
|
Avoids the following error:
|
|
|
|
|
|
|
|
File "/usr/share/virt-manager/virtinst/progress.py", line 484, in format_number
|
|
|
|
if isinstance(number, int) or isinstance(number, long):
|
|
|
|
NameError: name 'long' is not defined
|
|
|
|
---
|
|
|
|
virtinst/progress.py | 3 ++-
|
|
|
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
|
|
|
2018-10-30 23:00:52 +01:00
|
|
|
Index: virt-manager-2.0.0/virtinst/progress.py
|
|
|
|
===================================================================
|
|
|
|
--- virt-manager-2.0.0.orig/virtinst/progress.py
|
|
|
|
+++ virt-manager-2.0.0/virtinst/progress.py
|
|
|
|
@@ -16,6 +16,7 @@ import math
|
2017-12-07 18:12:07 +01:00
|
|
|
import fcntl
|
|
|
|
import struct
|
|
|
|
import termios
|
|
|
|
+from six import integer_types
|
|
|
|
|
2018-10-30 23:00:52 +01:00
|
|
|
# Code from https://mail.python.org/pipermail/python-list/2000-May/033365.html
|
2017-12-07 18:12:07 +01:00
|
|
|
def terminal_width(fd=1):
|
2018-10-30 23:00:52 +01:00
|
|
|
@@ -464,7 +465,7 @@ def format_number(number, SI=0, space='
|
2017-12-07 18:12:07 +01:00
|
|
|
depth = depth + 1
|
|
|
|
number = number / step
|
|
|
|
|
2018-10-30 23:00:52 +01:00
|
|
|
- if isinstance(number, int):
|
2017-12-07 18:12:07 +01:00
|
|
|
+ if isinstance(number, integer_types):
|
|
|
|
# it's an int or a long, which means it didn't get divided,
|
|
|
|
# which means it's already short enough
|
|
|
|
fmt = '%i%s%s'
|