-import os
+import os, sys
from waflib import Utils, Context
import samba_utils
from samba_git import find_git
environ = dict(os.environ)
environ["GIT_DIR"] = '%s/.git' % path
environ["GIT_WORK_TREE"] = path
- git = Utils.cmd_output(env.GIT + ' show --pretty=format:"%h%n%ct%n%H%n%cd" --stat HEAD', silent=True, env=environ)
+ git = samba_utils.get_string(Utils.cmd_output(env.GIT + ' show --pretty=format:"%h%n%ct%n%H%n%cd" --stat HEAD', silent=True, env=environ))
lines = git.splitlines()
if not lines or len(lines) < 4:
for name in sorted(self.vcs_fields.keys()):
string+="#define SAMBA_VERSION_%s " % name
value = self.vcs_fields[name]
- if isinstance(value, basestring):
+ string_types = str
+ if sys.version_info[0] < 3:
+ string_types = basestring
+ if isinstance(value, string_types):
string += "\"%s\"" % value
elif type(value) is int:
string += "%d" % value