diff options
author | Radostin Stoyanov <rstoyanov1@gmail.com> | 2017-10-11 12:35:54 +0100 |
---|---|---|
committer | Cole Robinson <crobinso@redhat.com> | 2017-10-20 13:18:31 -0400 |
commit | a2bcd6c43a77b03693d11d231e8c0a7b0609889b (patch) | |
tree | 5c784f80ff2cf2241c3a345ad48fb355d99aeb47 /virtinst/support.py | |
parent | 75210ed37c0c5de569de73e04488808a2521a011 (diff) | |
download | virt-manager-a2bcd6c43a77b03693d11d231e8c0a7b0609889b.tar.gz |
Do not compare between None and int
In Python 2 comparison between int and None is allowed but in
Pyhton 3 it is not.
Example:
Pyhton 2
>>> None > 0
False
Python 3
>>> None > 0
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: '>' not supported between instances of 'NoneType' and 'int'
Diffstat (limited to 'virtinst/support.py')
-rw-r--r-- | virtinst/support.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/virtinst/support.py b/virtinst/support.py index 19160fba..6b0489a5 100644 --- a/virtinst/support.py +++ b/virtinst/support.py @@ -187,7 +187,8 @@ class _SupportCheck(object): actual_hv_version = conn.conn_version() # Check that local libvirt version is sufficient - if _version_str_to_int(self.version) > actual_libvirt_version: + v = _version_str_to_int(self.version) + if v and (v > actual_libvirt_version): return False if self.hv_version: |