From cd168b1d1b884434bb746cd7e751747ea56e474a Mon Sep 17 00:00:00 2001 From: Krzysztof Boronski Date: Mon, 11 Jul 2022 08:10:28 -0500 Subject: [PATCH] Use defaults for environ.get() Signed-off-by: Krzysztof Boronski --- f4pga/__init__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/f4pga/__init__.py b/f4pga/__init__.py index 906256a..194742d 100755 --- a/f4pga/__init__.py +++ b/f4pga/__init__.py @@ -75,11 +75,11 @@ install_dir = environ.get("F4PGA_INSTALL_DIR", "/usr/local") mypath = str(Path(__file__).resolve().parent) -bin_dir_path = environ.get('F4PGA_BIN_DIR') -if bin_dir_path is None: - bin_dir_path = str(Path(sys_argv[0]).resolve().parent.parent) - -share_dir_path = environ.get('F4PGA_SHARE_DIR') +bin_dir_path = \ + environ.get('F4PGA_BIN_DIR', str(Path(sys_argv[0]).resolve().parent.parent)) +share_dir_path = \ + environ.get('F4PGA_SHARE_DIR', + str(Path(f'{install_dir}/xc7/install/share/symbiflow').resolve())) if share_dir_path is None: share_dir_path = str(Path(f'{install_dir}/xc7/install/share/symbiflow').resolve())