On Tue, Dec 05, 2017 at 10:53:21AM +0100, Cédric Bosdonnat wrote:
Python2 is going to die soon, convert to python3.
I'm unclear whether this change drops py2 support, or whether it makes it
work with py2+3 in parallel.
The commit message suggests py3 only, but then this:
@@ -418,6 +416,18 @@ class GenericContainer(Container):
def is_template_unit(unit):
return '@' in unit
+# Python 2 / 3 compability helpers
+def get_next(obj):
+ if hasattr(obj, 'next'):
+ return obj.next()
+ else:
+ return next(obj)
+
+def string(obj):
+ if isinstance(obj, bytes):
+ return str(obj, encoding='utf-8')
+ return obj
suggests py2+3 in parallel
I don't mind being py3 only.
Regards,
Daniel
--
|:
https://berrange.com -o-
https://www.flickr.com/photos/dberrange :|
|:
https://libvirt.org -o-
https://fstop138.berrange.com :|
|:
https://entangle-photo.org -o-
https://www.instagram.com/dberrange :|