From 81b93ebbc3c6e772eda9623b79c9d04365b88100 Mon Sep 17 00:00:00 2001 From: zhangbo9674 <82555433+zhangbo9674@users.noreply.github.com> Date: Mon, 31 Oct 2022 10:58:56 +0800 Subject: [PATCH] fix python module not found bug (#47438) * fix python module not found bug * delete unused cast,test=allcases --- paddle/scripts/paddle_build.sh | 1 - python/paddle/fluid/tests/unittests/__init__.py | 9 ++++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/paddle/scripts/paddle_build.sh b/paddle/scripts/paddle_build.sh index 7042fa3dec..e29fd6549e 100755 --- a/paddle/scripts/paddle_build.sh +++ b/paddle/scripts/paddle_build.sh @@ -2857,7 +2857,6 @@ function parallel_test() { cd ${PADDLE_ROOT}/build pip install hypothesis pip install ${PADDLE_ROOT}/build/python/dist/*whl - cp ${PADDLE_ROOT}/build/python/paddle/fluid/tests/unittests/op_test.py ${PADDLE_ROOT}/build/python cp ${PADDLE_ROOT}/build/python/paddle/fluid/tests/unittests/testsuite.py ${PADDLE_ROOT}/build/python cp -r ${PADDLE_ROOT}/build/python/paddle/fluid/tests/unittests/white_list ${PADDLE_ROOT}/build/python ut_total_startTime_s=`date +%s` diff --git a/python/paddle/fluid/tests/unittests/__init__.py b/python/paddle/fluid/tests/unittests/__init__.py index 126cbeb493..3a0e2ace56 100644 --- a/python/paddle/fluid/tests/unittests/__init__.py +++ b/python/paddle/fluid/tests/unittests/__init__.py @@ -18,9 +18,8 @@ import os -if os.name == 'nt': - import sys +import sys - dirname, filename = os.path.split(os.path.abspath(__file__)) - sys.path.insert(0, dirname) - print(sys.path) +dirname, filename = os.path.split(os.path.abspath(__file__)) +sys.path.insert(0, dirname) +print(sys.path) -- GitLab