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 a5ad810321555a4f93c76ba3cc3dcc3658206fbe..6a8ffb6e90c2f0f6c08993d4daabe578b352ceee 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]
         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
                 string += "\"%s\"" % value
             elif type(value) is int:
                 string += "%d" % value