From 5c14fdcf0c43db21ddd58915fa25a8b50541ca5e Mon Sep 17 00:00:00 2001 From: Leo Chen Date: Thu, 27 Aug 2020 11:54:31 +0800 Subject: [PATCH] fix bug when get_glibc_ver returns None (#26693) --- python/paddle/fluid/core.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/paddle/fluid/core.py b/python/paddle/fluid/core.py index d87363abf14..a05aa3b0a84 100644 --- a/python/paddle/fluid/core.py +++ b/python/paddle/fluid/core.py @@ -201,10 +201,13 @@ def pre_load(dso_name): def get_glibc_ver(): - return run_shell_command("ldd --version | awk '/ldd/{print $NF}'").strip() + return run_shell_command("ldd --version | awk '/ldd/{print $NF}'") def less_than_ver(a, b): + if a is None or b is None: + return False + import re import operator -- GitLab