@@ -218,10 +218,10 @@ def popen(command, stdin=None, **kwargs):
218
218
try :
219
219
proc = subprocess .Popen (command , ** kwargs )
220
220
except OSError as e :
221
- if e [0 ] == errno .ENOENT :
221
+ if e . args [0 ] == errno .ENOENT :
222
222
error (
223
223
"Could not execute \" %s\" .\n "
224
- "Please verify that it's installed and accessible from your current path by executing \" %s\" .\n " % (command [0 ], command [0 ]), e [0 ])
224
+ "Please verify that it's installed and accessible from your current path by executing \" %s\" .\n " % (command [0 ], command [0 ]), e . args [0 ])
225
225
else :
226
226
raise e
227
227
@@ -234,10 +234,10 @@ def pquery(command, output_callback=None, stdin=None, **kwargs):
234
234
try :
235
235
proc = subprocess .Popen (command , bufsize = 0 , stdout = subprocess .PIPE , stderr = subprocess .PIPE , ** kwargs )
236
236
except OSError as e :
237
- if e [0 ] == errno .ENOENT :
237
+ if e . args [0 ] == errno .ENOENT :
238
238
error (
239
239
"Could not execute \" %s\" .\n "
240
- "Please verify that it's installed and accessible from your current path by executing \" %s\" .\n " % (command [0 ], command [0 ]), e [0 ])
240
+ "Please verify that it's installed and accessible from your current path by executing \" %s\" .\n " % (command [0 ], command [0 ]), e . args [0 ])
241
241
else :
242
242
raise e
243
243
@@ -353,7 +353,7 @@ def clone(url, path=None, depth=None, protocol=None):
353
353
except Exception as e :
354
354
if os .path .isdir (path ):
355
355
rmtree_readonly (path )
356
- error (e [1 ], e [0 ])
356
+ error (e . args [1 ], e . args [0 ])
357
357
358
358
def fetch_rev (url , rev ):
359
359
rev_file = os .path .join ('.' + Bld .name , '.rev-' + rev + '.zip' )
@@ -400,7 +400,7 @@ def checkout(rev, clean=False):
400
400
Bld .unpack_rev (rev )
401
401
Bld .seturl (url + '/' + rev )
402
402
except Exception as e :
403
- error (e [1 ], e [0 ])
403
+ error (e . args [1 ], e . args [0 ])
404
404
405
405
def update (rev = None , clean = False , clean_files = False , is_local = False ):
406
406
return Bld .checkout (rev , clean )
@@ -2000,8 +2000,7 @@ def import_(url, path=None, ignore=False, depth=None, protocol=None, insecure=Fa
2000
2000
if ignore :
2001
2001
warning (err )
2002
2002
else :
2003
- print ("HI" )
2004
- error (err , e [0 ])
2003
+ error (err , e .args [0 ])
2005
2004
else :
2006
2005
err = "Unable to clone repository (%s)" % url
2007
2006
if ignore :
@@ -2152,7 +2151,7 @@ def publish(all_refs=None, msg=None, top=True):
2152
2151
if top :
2153
2152
action ("Nothing to publish to the remote repository (the source tree is unmodified)" )
2154
2153
except ProcessException as e :
2155
- if e [0 ] != 1 :
2154
+ if e . args [0 ] != 1 :
2156
2155
raise e
2157
2156
2158
2157
@@ -2219,7 +2218,7 @@ def update(rev=None, clean=False, clean_files=False, clean_deps=False, ignore=Fa
2219
2218
if ignore :
2220
2219
warning (err )
2221
2220
else :
2222
- error (err , e [0 ])
2221
+ error (err , e . args [0 ])
2223
2222
2224
2223
repo .rm_untracked ()
2225
2224
if top and cwd_type == 'library' :
@@ -2993,14 +2992,14 @@ def main():
2993
2992
except ProcessException as e :
2994
2993
error (
2995
2994
"\" %s\" returned error code %d.\n "
2996
- "Command \" %s\" in \" %s\" " % (e [1 ], e [0 ], e [2 ], e [3 ]), e [0 ])
2995
+ "Command \" %s\" in \" %s\" " % (e . args [1 ], e . args [0 ], e . args [2 ], e . args [3 ]), e . args [0 ])
2997
2996
except OSError as e :
2998
- if e [0 ] == errno .ENOENT :
2997
+ if e . args [0 ] == errno .ENOENT :
2999
2998
error (
3000
2999
"Could not detect one of the command-line tools.\n "
3001
- "You could retry the last command with \" -v\" flag for verbose output\n " , e [0 ])
3000
+ "You could retry the last command with \" -v\" flag for verbose output\n " , e . args [0 ])
3002
3001
else :
3003
- error ('OS Error: %s' % e [1 ], e [0 ])
3002
+ error ('OS Error: %s' % e . args [1 ], e . args [0 ])
3004
3003
except KeyboardInterrupt :
3005
3004
info ('User aborted!' , - 1 )
3006
3005
sys .exit (255 )
0 commit comments