diff --git a/setup.py b/setup.py index 01014d0..50b5f19 100644 --- a/setup.py +++ b/setup.py @@ -91,7 +91,10 @@ def __new__(cls, s): if IS_WINDOWS: # don't try to import MSVC compiler on non-windows platforms # as this triggers unnecessary warnings - from distutils.msvccompiler import MSVCCompiler + try: + from distutils._msvccompiler import MSVCCompiler + except: + from distutils.msvccompiler import MSVCCompiler else: class MSVCCompiler(object): # dummy marker class diff --git a/version.py b/version.py index 141f20e..ba3662b 100644 --- a/version.py +++ b/version.py @@ -43,13 +43,13 @@ def call_git_describe(abbrev=4): try: p = Popen(['git', 'describe', '--abbrev=%d' % abbrev], - stdout=PIPE, stderr=PIPE) + stdout=PIPE, stderr=PIPE, text=True) p.stderr.close() line = p.stdout.readlines()[0] version = line.strip() if version[:1] == 'v': version = version[1:] - return version + return version.replace('-g', '+g') except: return None