buildtools/wafsamba: fix basestring not defined error in PY3
authorNoel Power <noel.power@suse.com>
Wed, 26 Sep 2018 15:22:35 +0000 (16:22 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 26 Sep 2018 23:54:27 +0000 (01:54 +0200)
Test for str first (which exists in py3 & py2) this avoids
the undefined runtime error.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
buildtools/wafsamba/samba_version.py

index a5ad810..6a8ffb6 100644 (file)
@@ -198,7 +198,7 @@ also accepted as dictionary entries here
         for name in sorted(self.vcs_fields.keys()):
             string+="#define SAMBA_VERSION_%s " % name
             value = self.vcs_fields[name]
-            if isinstance(value, basestring):
+            if isinstance(value, str) or isinstance(value, basestring):
                 string += "\"%s\"" % value
             elif type(value) is int:
                 string += "%d" % value