@@ -134,17 +134,18 @@ def get_git_version():
134134 # this may fail with exceptions
135135 cmd = 'git' , 'describe' , '--tags' , '--long' , '--dirty' ,
136136 version = subprocess .check_output (cmd , stderr = subprocess .STDOUT ).strip ()
137- dirty = version .endswith (b'-dirty' )
137+ version = version .decode ('utf-8' )
138+ dirty = version .endswith ('-dirty' )
138139 if dirty :
139- version , _ , _ = version .rpartition (b '-' )
140+ version , _ , _ = version .rpartition ('-' )
140141
141- version , _ , commit = version .rpartition (b '-' )
142- tag , _ , distance = version .rpartition (b '-' )
142+ version , _ , commit = version .rpartition ('-' )
143+ tag , _ , distance = version .rpartition ('-' )
143144
144145 # lower tag and strip V prefix in tags
145- tag = tag .lower ().lstrip (b 'v' ).strip ()
146+ tag = tag .lower ().lstrip ('v' ).strip ()
146147 # strip leading g from git describe commit
147- commit = commit .lstrip (b 'g' ).strip ()
148+ commit = commit .lstrip ('g' ).strip ()
148149 return tag , int (distance ), commit , dirty
149150
150151
@@ -193,6 +194,7 @@ def build(clean=True, app_name=APP_NAME,
193194 npm_bin = subprocess .check_output (['npm' , 'bin' ], stderr = subprocess .STDOUT , shell = True )
194195 else :
195196 npm_bin = subprocess .check_output (['npm' , 'bin' ], stderr = subprocess .STDOUT ,)
197+ npm_bin = npm_bin .decode ('utf-8' )
196198 npm_bin = npm_bin .strip ()
197199 print ('using NPM bin at:' , npm_bin )
198200
@@ -203,7 +205,7 @@ def build(clean=True, app_name=APP_NAME,
203205 os .makedirs (build_dir )
204206
205207 # run rebuild
206- electron_rebuild = os .path .join (npm_bin . decode () , 'electron-rebuild' )
208+ electron_rebuild = os .path .join (npm_bin , 'electron-rebuild' )
207209 print ('Running electron-rebuild...' )
208210 call ([electron_rebuild ])
209211
@@ -240,7 +242,7 @@ def build(clean=True, app_name=APP_NAME,
240242 ]
241243
242244 # run the build with electron_packager
243- electron_packager = os .path .join (npm_bin . decode () , 'electron-packager' )
245+ electron_packager = os .path .join (npm_bin , 'electron-packager' )
244246 cmd = [electron_packager ] + electron_args
245247 print ('Running electron-packager...' )
246248 call (cmd )
0 commit comments