Skip to content

Commit

Permalink
Allow whitespace in pyvenv.cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
pradyunsg committed Nov 5, 2019
1 parent 5332ec5 commit 57d34e0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/pip/_internal/utils/virtualenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import logging
import os
import re
import site
import sys

Expand All @@ -11,6 +12,9 @@
from typing import List, Optional

logger = logging.getLogger(__name__)
_INCLUDE_SYSTEM_SITE_PACKAGES_REGEX = re.compile(
r"include-system-site-packages\s*=\s*(?P<value>true|false)"
)


def _running_under_venv():
Expand Down Expand Up @@ -76,7 +80,11 @@ def _no_global_under_venv():
)
return True

return "include-system-site-packages = false" in cfg_lines
for line in cfg_lines:
match = _INCLUDE_SYSTEM_SITE_PACKAGES_REGEX.match(line)
if match is not None and match.group('value') == 'false':
return True
return False


def _no_global_under_regular_virtualenv():
Expand Down

0 comments on commit 57d34e0

Please sign in to comment.