We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0348f3f commit 89a60d7Copy full SHA for 89a60d7
python/paddle/base/core.py
@@ -14,7 +14,6 @@
14
15
import os
16
import platform
17
-import re
18
import site
19
import sys
20
import warnings
@@ -195,18 +194,8 @@ def run_shell_command(cmd):
195
194
return out.decode('utf-8').strip()
196
197
198
-def is_valid_filename(filename):
199
- pattern = re.compile(r'^[a-zA-Z0-9_.-]+$')
200
- if pattern.match(filename):
201
- return True
202
- else:
203
- return False
204
-
205
206
def get_dso_path(core_so, dso_name):
207
if core_so and dso_name:
208
- assert is_valid_filename(core_so), 'core_so must be a file name.'
209
- assert is_valid_filename(dso_name), 'dso_name must be a file name.'
210
return run_shell_command(
211
f"ldd {core_so}|grep {dso_name}|awk '{{print $3}}'"
212
)
0 commit comments