Fix "ValueError: Empty module name" when project dir (first argument of django_test_manage.py) ends in a slash

Note that `os.path.basename(path)` returns an empty string (`''`) when `path` ends in a slash.

GitOrigin-RevId: e400e794d5e0de0cf29ab6796ffac5972f50eb53
This commit is contained in:
Alexander Koshevoy
2022-02-08 23:25:31 +00:00
committed by intellij-monorepo-bot
parent 0415d93257
commit 98d818cf53
+1 -1
View File
@@ -28,7 +28,7 @@ try:
# setup environment
# this stuff was done earlier by setup_environ() which was removed in 1.4
sys.path.append(os.path.join(project_directory, os.pardir))
project_name = os.path.basename(project_directory)
project_name = os.path.basename(os.path.normpath(project_directory))
__import__(project_name)
except ImportError:
# project has custom structure (project directory is not importable)