setup_venv: Don’t pip uninstall typing; it’s no longer installed.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
Anders Kaseorg 2019-08-12 13:52:22 -07:00 committed by Tim Abbott
parent a5596011a0
commit 86f8bb83ab
1 changed files with 0 additions and 11 deletions

View File

@ -2,7 +2,6 @@ import logging
import os
import shutil
import subprocess
import sys
from scripts.lib.zulip_tools import run, run_as_root, ENDC, WARNING
from scripts.lib.hash_reqs import expand_reqs
@ -344,14 +343,4 @@ def do_setup_virtualenv(venv_path, requirements_file, virtualenv_args):
print(WARNING + "`pip install` failed; retrying..." + ENDC)
install_venv_deps(pip, requirements_file)
# The typing module has been included in stdlib since 3.5.
# Installing a pypi version of it has been harmless until a bug
# "AttributeError: type object 'Callable' has no attribute
# '_abc_registry'" happens in 3.7. And so just to be safe, it is
# disabled from now on for all >= 3.5 versions.
# Remove this once 3.4 is no longer supported.
at_least_35 = (sys.version_info.major == 3) and (sys.version_info.minor >= 5)
if at_least_35 and ('python2.7' not in virtualenv_args):
run([pip, "uninstall", "-y", "typing"])
run_as_root(["chmod", "-R", "a+rX", venv_path])