From 49ca11153d99a3efd88a0d58e4de036b8c227e69 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Thu, 23 Jun 2022 09:27:27 +0200 Subject: [PATCH] Simplify code which checks for numba It is not necessary to run a subprocess to check whether numba can be imported. Signed-off-by: Stefan Weil --- pero_ocr/utils.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pero_ocr/utils.py b/pero_ocr/utils.py index c700f99..4c6e732 100644 --- a/pero_ocr/utils.py +++ b/pero_ocr/utils.py @@ -3,11 +3,8 @@ import subprocess try: - subprocess.check_output( - '{} -c "import numba"'.format(sys.executable), shell=True - ) - print('numba available, importing jit') from numba import jit + print('numba available, importing jit') except Exception: print('cannot import numba, creating dummy jit definition')