@@ -46,7 +46,7 @@ def git_config_get(option, default=None):
46
46
'''
47
47
try :
48
48
return subprocess .check_output ([GIT ,'config' ,'--get' ,option ]).rstrip ().decode ('utf-8' )
49
- except subprocess .CalledProcessError as e :
49
+ except subprocess .CalledProcessError :
50
50
return default
51
51
52
52
def retrieve_pr_info (repo ,pull ):
@@ -193,23 +193,23 @@ def main():
193
193
devnull = open (os .devnull ,'w' )
194
194
try :
195
195
subprocess .check_call ([GIT ,'checkout' ,'-q' ,branch ])
196
- except subprocess .CalledProcessError as e :
196
+ except subprocess .CalledProcessError :
197
197
print ("ERROR: Cannot check out branch %s." % (branch ), file = stderr )
198
198
sys .exit (3 )
199
199
try :
200
200
subprocess .check_call ([GIT ,'fetch' ,'-q' ,host_repo ,'+refs/pull/' + pull + '/*:refs/heads/pull/' + pull + '/*' ,
201
201
'+refs/heads/' + branch + ':refs/heads/' + base_branch ])
202
- except subprocess .CalledProcessError as e :
202
+ except subprocess .CalledProcessError :
203
203
print ("ERROR: Cannot find pull request #%s or branch %s on %s." % (pull ,branch ,host_repo ), file = stderr )
204
204
sys .exit (3 )
205
205
try :
206
206
subprocess .check_call ([GIT ,'log' ,'-q' ,'-1' ,'refs/heads/' + head_branch ], stdout = devnull , stderr = stdout )
207
- except subprocess .CalledProcessError as e :
207
+ except subprocess .CalledProcessError :
208
208
print ("ERROR: Cannot find head of pull request #%s on %s." % (pull ,host_repo ), file = stderr )
209
209
sys .exit (3 )
210
210
try :
211
211
subprocess .check_call ([GIT ,'log' ,'-q' ,'-1' ,'refs/heads/' + merge_branch ], stdout = devnull , stderr = stdout )
212
- except subprocess .CalledProcessError as e :
212
+ except subprocess .CalledProcessError :
213
213
print ("ERROR: Cannot find merge of pull request #%s on %s." % (pull ,host_repo ), file = stderr )
214
214
sys .exit (3 )
215
215
subprocess .check_call ([GIT ,'checkout' ,'-q' ,base_branch ])
@@ -230,7 +230,7 @@ def main():
230
230
message += '\n \n Pull request description:\n \n ' + body .replace ('\n ' , '\n ' ) + '\n '
231
231
try :
232
232
subprocess .check_call ([GIT ,'merge' ,'-q' ,'--commit' ,'--no-edit' ,'--no-ff' ,'-m' ,message .encode ('utf-8' ),head_branch ])
233
- except subprocess .CalledProcessError as e :
233
+ except subprocess .CalledProcessError :
234
234
print ("ERROR: Cannot be merged cleanly." ,file = stderr )
235
235
subprocess .check_call ([GIT ,'merge' ,'--abort' ])
236
236
sys .exit (4 )
@@ -249,12 +249,12 @@ def main():
249
249
try :
250
250
first_sha512 = tree_sha512sum ()
251
251
message += '\n \n Tree-SHA512: ' + first_sha512
252
- except subprocess .CalledProcessError as e :
252
+ except subprocess .CalledProcessError :
253
253
print ("ERROR: Unable to compute tree hash" )
254
254
sys .exit (4 )
255
255
try :
256
256
subprocess .check_call ([GIT ,'commit' ,'--amend' ,'-m' ,message .encode ('utf-8' )])
257
- except subprocess .CalledProcessError as e :
257
+ except subprocess .CalledProcessError :
258
258
print ("ERROR: Cannot update message." , file = stderr )
259
259
sys .exit (4 )
260
260
@@ -299,7 +299,7 @@ def main():
299
299
try :
300
300
subprocess .check_call ([GIT ,'commit' ,'-q' ,'--gpg-sign' ,'--amend' ,'--no-edit' ])
301
301
break
302
- except subprocess .CalledProcessError as e :
302
+ except subprocess .CalledProcessError :
303
303
print ("Error while signing, asking again." ,file = stderr )
304
304
elif reply == 'x' :
305
305
print ("Not signing off on merge, exiting." ,file = stderr )
0 commit comments