@@ -129,10 +129,9 @@ def get_rizin_version(rizin_path) -> Str:
129
129
:return: the version number of the Rizin instance
130
130
"""
131
131
try :
132
- process = subprocess .run (
132
+ result = subprocess .check_output (
133
133
[rizin_path , "-v" ], timeout = 5 , check = True , stdout = subprocess .PIPE
134
134
)
135
- result = str (process .stdout )
136
135
137
136
matched_versions = re .finditer (
138
137
r"[0-9]+\.[0-9]+\.[0-9]+" , result [: result .index ("@" )]
@@ -144,7 +143,10 @@ def get_rizin_version(rizin_path) -> Str:
144
143
else :
145
144
return None
146
145
147
- except BaseException :
146
+ except subprocess .CalledProcessError :
147
+ return None
148
+
149
+ except OSError :
148
150
return None
149
151
150
152
@@ -178,7 +180,10 @@ def download_rizin(target_path) -> Boolean:
178
180
179
181
return True
180
182
181
- except subprocess .CalledProcessError as error :
183
+ except subprocess .CalledProcessError :
184
+ print_error ("An error occurred when downloading Rizin.\n " )
185
+
186
+ except OSError :
182
187
print_error ("An error occurred when downloading Rizin.\n " )
183
188
184
189
return False
@@ -242,12 +247,18 @@ def update_rizin(source_path, target_commit) -> Boolean:
242
247
return True
243
248
244
249
except subprocess .CalledProcessError as error :
245
- print_error ("An error occurred when updating Rizin.\n " )
250
+ pass
251
+ except OSError :
252
+ pass
246
253
247
- for line in error .stderr .decode ().splitlines ():
248
- print_error (line )
254
+ print_error ("An error occurred when updating Rizin.\n " )
249
255
250
- return False
256
+ for line in error .stderr .decode ().splitlines ():
257
+ print_error (line )
258
+
259
+ print_error ("An error occurred when downloading Rizin.\n " )
260
+
261
+ return False
251
262
252
263
253
264
def find_rizin_instance (
0 commit comments