|
5 | 5 |
|
6 | 6 | import ctypes |
7 | 7 | import os |
| 8 | +import subprocess # nosec B404 |
8 | 9 | import sys |
9 | 10 | import tempfile |
10 | 11 | import time |
11 | 12 | from struct import pack, unpack |
12 | | -from subprocess import call # nosec B404 |
13 | 13 |
|
14 | 14 | import highlevelcrypto |
15 | 15 | import openclpow |
@@ -278,18 +278,26 @@ def buildCPoW(): |
278 | 278 | try: |
279 | 279 | if "bsd" in sys.platform: |
280 | 280 | # BSD make |
281 | | - call(["make", "-C", os.path.join(paths.codePath(), "bitmsghash"), |
282 | | - '-f', 'Makefile.bsd']) # nosec B607, B603 |
| 281 | + subprocess.check_call([ # nosec B607, B603 |
| 282 | + "make", "-C", os.path.join(paths.codePath(), "bitmsghash"), |
| 283 | + '-f', 'Makefile.bsd']) |
283 | 284 | else: |
284 | 285 | # GNU make |
285 | | - call([ # nosec B607, B603 |
| 286 | + subprocess.check_call([ # nosec B607, B603 |
286 | 287 | "make", "-C", os.path.join(paths.codePath(), "bitmsghash")]) |
287 | | - if os.path.exists(os.path.join(paths.codePath(), "bitmsghash", "bitmsghash.so")): |
| 288 | + if os.path.exists( |
| 289 | + os.path.join(paths.codePath(), "bitmsghash", "bitmsghash.so") |
| 290 | + ): |
288 | 291 | init() |
289 | 292 | notifyBuild(True) |
290 | 293 | else: |
291 | 294 | notifyBuild(True) |
| 295 | + except (OSError, subprocess.CalledProcessError): |
| 296 | + notifyBuild(True) |
292 | 297 | except: # noqa:E722 |
| 298 | + logger.warning( |
| 299 | + 'Unexpected exception rised when tried to build bitmsghash lib', |
| 300 | + exc_info=True) |
293 | 301 | notifyBuild(True) |
294 | 302 |
|
295 | 303 |
|
|
0 commit comments