From 69c3a90eeaef3237c46269a857617d72c6af4d68 Mon Sep 17 00:00:00 2001 From: Eli Bendersky Date: Mon, 8 Apr 2013 06:45:01 -0700 Subject: [PATCH] better way to check if a dir exists --- test/utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/utils.py b/test/utils.py index 7a3b83f..908cfcc 100644 --- a/test/utils.py +++ b/test/utils.py @@ -36,8 +36,7 @@ def run_exe(exe_path, args): def is_in_rootdir(): """ Check whether the current dir is the root dir of pyelftools """ - dirstuff = os.listdir('.') - return 'test' in dirstuff and 'elftools' in dirstuff + return os.path.isdir('test') and os.path.isdir('elftools') def dump_output_to_temp_files(testlog, *args): -- 2.30.2