diff options
| author | Dan Yeaw <dan@yeaw.me> | 2020-10-03 10:46:06 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-03 15:46:06 +0100 |
| commit | adcf327ee507498a613dc6f235c24c8f2576b6c6 (patch) | |
| tree | 377092ab00c8aeab631af79640a5a6e513e6243b /src/virtualenv/activation | |
| parent | 59277f03401c29f080a63016fa3d1191acec3ee4 (diff) | |
| download | virtualenv-adcf327ee507498a613dc6f235c24c8f2576b6c6.tar.gz | |
Fix cygwin NoneType error if POSIX path in dest (#1964)
Closes #1962. Corrects an AttributeError for a regex match not
found if the cygwin path is already in posix format.
Diffstat (limited to 'src/virtualenv/activation')
| -rw-r--r-- | src/virtualenv/activation/via_template.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/virtualenv/activation/via_template.py b/src/virtualenv/activation/via_template.py index ad91f24..6839f05 100644 --- a/src/virtualenv/activation/via_template.py +++ b/src/virtualenv/activation/via_template.py @@ -38,7 +38,10 @@ class ViaTemplateActivator(Activator): if any(platform in current_platform for platform in platforms): pattern = re.compile("^([A-Za-z]):(.*)") match = pattern.match(str(creator.dest)) - virtual_env = "/" + match.group(1).lower() + match.group(2) + if match: + virtual_env = "/" + match.group(1).lower() + match.group(2) + else: + virtual_env = str(creator.dest) else: virtual_env = str(creator.dest) return { |
