mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Merge pull request #4992 from pradyunsg/vendor/disable-appdirs-loading-c-library
Disable vendored appdirs loading C library
This commit is contained in:
commit
1ea3f89ff9
4 changed files with 37 additions and 12 deletions
|
@ -557,18 +557,14 @@ def _get_win_folder_with_jna(csidl_name):
|
|||
|
||||
if system == "win32":
|
||||
try:
|
||||
import win32com.shell
|
||||
_get_win_folder = _get_win_folder_with_pywin32
|
||||
from ctypes import windll
|
||||
_get_win_folder = _get_win_folder_with_ctypes
|
||||
except ImportError:
|
||||
try:
|
||||
from ctypes import windll
|
||||
_get_win_folder = _get_win_folder_with_ctypes
|
||||
import com.sun.jna
|
||||
_get_win_folder = _get_win_folder_with_jna
|
||||
except ImportError:
|
||||
try:
|
||||
import com.sun.jna
|
||||
_get_win_folder = _get_win_folder_with_jna
|
||||
except ImportError:
|
||||
_get_win_folder = _get_win_folder_from_registry
|
||||
_get_win_folder = _get_win_folder_from_registry
|
||||
|
||||
|
||||
#---- self test code
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
from appdirs import *
|
|
@ -144,9 +144,11 @@ def update_stubs(ctx):
|
|||
|
||||
print("[vendoring.update_stubs] Add mypy stubs")
|
||||
|
||||
# Some projects need stubs other than a simple <name>.pyi
|
||||
extra_stubs_needed = {
|
||||
"six": ["six.__init__", "six.moves"]
|
||||
# Some projects need stubs other than a simple <name>.pyi
|
||||
"six": ["six.__init__", "six.moves"],
|
||||
# Some projects should not have stubs coz they're single file modules
|
||||
"appdirs": [],
|
||||
}
|
||||
|
||||
for lib in vendored_libs:
|
||||
|
|
28
tasks/vendoring/patches/appdirs.patch
Normal file
28
tasks/vendoring/patches/appdirs.patch
Normal file
|
@ -0,0 +1,28 @@
|
|||
diff --git a/src/pip/_vendor/appdirs.py b/src/pip/_vendor/appdirs.py
|
||||
index ae67001a..2bd39110 100644
|
||||
--- a/src/pip/_vendor/appdirs.py
|
||||
+++ b/src/pip/_vendor/appdirs.py
|
||||
@@ -557,18 +557,14 @@ def _get_win_folder_with_jna(csidl_name):
|
||||
|
||||
if system == "win32":
|
||||
try:
|
||||
- import win32com.shell
|
||||
- _get_win_folder = _get_win_folder_with_pywin32
|
||||
+ from ctypes import windll
|
||||
+ _get_win_folder = _get_win_folder_with_ctypes
|
||||
except ImportError:
|
||||
try:
|
||||
- from ctypes import windll
|
||||
- _get_win_folder = _get_win_folder_with_ctypes
|
||||
+ import com.sun.jna
|
||||
+ _get_win_folder = _get_win_folder_with_jna
|
||||
except ImportError:
|
||||
- try:
|
||||
- import com.sun.jna
|
||||
- _get_win_folder = _get_win_folder_with_jna
|
||||
- except ImportError:
|
||||
- _get_win_folder = _get_win_folder_from_registry
|
||||
+ _get_win_folder = _get_win_folder_from_registry
|
||||
|
||||
|
||||
#---- self test code
|
Loading…
Reference in a new issue