From 96d0919fa2130791eb86c4fff7d9bdd64c984b44 Mon Sep 17 00:00:00 2001 From: Erik Norvell Date: Mon, 7 Oct 2024 14:07:39 +0200 Subject: [PATCH] Hack to resolve import when using from command line or from within scripts. --- tests/cmp_pcm.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/cmp_pcm.py b/tests/cmp_pcm.py index 67aeff0dd9..6a72e0523f 100755 --- a/tests/cmp_pcm.py +++ b/tests/cmp_pcm.py @@ -15,7 +15,11 @@ sys.path.append(os.path.join(os.path.dirname(THIS_PATH), "../scripts")) import numpy as np import pyaudio3dtools import pyivastest -from .constants import ODG_PATTERN_PQEVALAUDIO +# Hack to resolve import when using from command line or from within scripts. +try: + from .constants import ODG_PATTERN_PQEVALAUDIO +except ImportError: + from constants import ODG_PATTERN_PQEVALAUDIO def cmp_pcm( -- GitLab