36c3f5d843
- More fixes for python3 (bsc#1070896) 0001-virtinst-python3-terminal-width-should-be-int.patch 0002-virtinst-python3-avoid-comparison-of-None-and-int.patch 0003-virtinst-python3-avoid-using-long-type.patch 0004-virtinst-python3-use-binary-mode-for-kernel.patch OBS-URL: https://build.opensuse.org/request/show/555017 OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=384
39 lines
1.2 KiB
Diff
39 lines
1.2 KiB
Diff
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(-)
|
|
|
|
diff --git a/virtinst/progress.py b/virtinst/progress.py
|
|
index eef3f7613506..bea4fad98938 100644
|
|
--- a/virtinst/progress.py
|
|
+++ b/virtinst/progress.py
|
|
@@ -30,6 +30,7 @@ import math
|
|
import fcntl
|
|
import struct
|
|
import termios
|
|
+from six import integer_types
|
|
|
|
# Code from http://mail.python.org/pipermail/python-list/2000-May/033365.html
|
|
def terminal_width(fd=1):
|
|
@@ -481,7 +482,7 @@ def format_number(number, SI=0, space=' '):
|
|
depth = depth + 1
|
|
number = number / step
|
|
|
|
- if isinstance(number, int) or isinstance(number, int):
|
|
+ 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'
|
|
--
|
|
2.15.1
|
|
|