virt-manager/0001-virtinst-python3-terminal-width-should-be-int.patch
Charles Arnold 36c3f5d843 Accepting request 555017 from home:mwilck:branches:Virtualization
- 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
2017-12-07 17:12:07 +00:00

31 lines
1022 B
Diff

From 79fa0f9de08f766dee6129fdc2c48648bba6fc6e Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Thu, 7 Dec 2017 11:09:02 +0100
Subject: [PATCH 1/4] virtinst: python3: terminal width should be int
This avoids errors like this:
File "/usr/share/virt-manager/virtinst/progress.py", line 224, in _term_add_bar
return tl.add(' [%-*.*s]' % (blen, blen, bar))
TypeError: * wants int
---
virtinst/progress.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/virtinst/progress.py b/virtinst/progress.py
index 868d0f0f0544..e07591a14fa0 100644
--- a/virtinst/progress.py
+++ b/virtinst/progress.py
@@ -79,7 +79,7 @@ class TerminalLine:
a number of different elements (default=2). """
if self._llen < fixed:
return 0
- return (self._llen - fixed) / elements
+ return int((self._llen - fixed) / elements)
def add(self, element, full_len=None):
""" If there is room left in the line, above min_len, add element.
--
2.15.1