Skip to content

Commit c0c4683

Browse files
committed
Improve message for working under root directory.
1 parent 94e7c97 commit c0c4683

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pipenv/project.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
PIPENV_PIPFILE, PIPENV_PYTHON, PIPENV_TEST_INDEX, PIPENV_VENV_IN_PROJECT,
3030
is_in_virtualenv
3131
)
32+
from .exceptions import PipenvUsageError
3233
from .utils import (
3334
cleanup_toml, convert_toml_outline_tables, find_requirements,
3435
get_canonical_names, get_url_name, get_workon_home, is_editable,
@@ -218,6 +219,10 @@ def _build_package_list(self, package_section):
218219
def name(self):
219220
if self._name is None:
220221
self._name = self.pipfile_location.split(os.sep)[-2]
222+
if not self._name:
223+
raise PipenvUsageError(
224+
"Pipenv is not intended to work under root directory, please choose another path."
225+
)
221226
return self._name
222227

223228
@property

0 commit comments

Comments
 (0)