mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-03-08 04:58:29 +03:00
Convert long to int
- Python 2 only k = 9223372036854775808L - Python 2 and 3: k = 9223372036854775808 See http://python-future.org/compatible_idioms.html#long-integers
This commit is contained in:
parent
6de65ab328
commit
95c695d774
@ -467,7 +467,7 @@ class vmmConnect(vmmGObjectUI):
|
||||
if host.startswith("linux-"):
|
||||
tmphost = host[6:]
|
||||
try:
|
||||
long(tmphost)
|
||||
int(tmphost)
|
||||
host = ""
|
||||
except ValueError:
|
||||
pass
|
||||
|
@ -391,7 +391,7 @@ class CloneStorageCreator(_StorageCreator):
|
||||
else:
|
||||
vfs = os.statvfs(os.path.dirname(self._path))
|
||||
avail = vfs.f_frsize * vfs.f_bavail
|
||||
need = long(self._size * 1024 * 1024 * 1024)
|
||||
need = int(self._size) * 1024 * 1024 * 1024
|
||||
if need > avail:
|
||||
if self._sparse:
|
||||
msg = _("The filesystem will not have enough free space"
|
||||
@ -411,7 +411,7 @@ class CloneStorageCreator(_StorageCreator):
|
||||
text = (_("Cloning %(srcfile)s") %
|
||||
{'srcfile': os.path.basename(self._input_path)})
|
||||
|
||||
size_bytes = long(self.get_size() * 1024 * 1024 * 1024)
|
||||
size_bytes = int(self.get_size()) * 1024 * 1024 * 1024
|
||||
progresscb.start(filename=self._output_path, size=size_bytes,
|
||||
text=text)
|
||||
|
||||
|
@ -481,7 +481,7 @@ def format_number(number, SI=0, space=' '):
|
||||
depth = depth + 1
|
||||
number = number / step
|
||||
|
||||
if isinstance(number, int) or isinstance(number, long):
|
||||
if isinstance(number, int):
|
||||
# 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'
|
||||
|
Loading…
x
Reference in New Issue
Block a user