From cf81d8e60761fa4c0e406f71daaa4040eae4b8ee Mon Sep 17 00:00:00 2001 From: Penghao Cen Date: Tue, 29 Aug 2017 09:50:29 +0800 Subject: [PATCH] Move path.exists if block inside None check --- configure.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/configure.py b/configure.py index b49cdf23832..fcf359d061d 100644 --- a/configure.py +++ b/configure.py @@ -686,11 +686,11 @@ def set_tf_cunn_version(environ_cp): cudnn_path_from_ldconfig = run_shell([ldconfig_bin, '-p']) cudnn_path_from_ldconfig = re.search('.*libcudnn.so .* => (.*)', cudnn_path_from_ldconfig) - if cudnn_path_from_ldconfig != None: + if cudnn_path_from_ldconfig: cudnn_path_from_ldconfig = cudnn_path_from_ldconfig.group(1) - if os.path.exists('%s.%s' % (cudnn_path_from_ldconfig, tf_cudnn_version)): - cudnn_install_path = os.path.dirname(cudnn_path_from_ldconfig) - break + if os.path.exists('%s.%s' % (cudnn_path_from_ldconfig, tf_cudnn_version)): + cudnn_install_path = os.path.dirname(cudnn_path_from_ldconfig) + break # Reset and Retry print(