Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
镜像
Python_Packaging_Authority
pip
提交
b20235d7
P
pip
项目概览
镜像
/
Python_Packaging_Authority
/
pip
12 个月 前同步成功
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
pip
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
b20235d7
编写于
3月 21, 2018
作者:
D
Donald Stufft
提交者:
GitHub
3月 21, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #5106 from dstufft/merged/9.0.3
Merged/9.0.3
上级
2634beb2
4c16e71c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
24 addition
and
6 deletion
+24
-6
NEWS.rst
NEWS.rst
+8
-0
src/pip/_vendor/requests/packages.py
src/pip/_vendor/requests/packages.py
+5
-3
tasks/vendoring/patches/requests.patch
tasks/vendoring/patches/requests.patch
+11
-3
未找到文件。
NEWS.rst
浏览文件 @
b20235d7
...
...
@@ -8,6 +8,14 @@
..
towncrier
release
notes
start
9.0.3
(
2018
-
03
-
21
)
==================
-
Fix
an
error
where
the
vendored
requests
was
not
correctly
containing
itself
to
only
the
internal
vendored
prefix
.
-
Restore
compatability
with
2.6
.
9.0.2
(
2018
-
03
-
16
)
==================
...
...
src/pip/_vendor/requests/packages.py
浏览文件 @
b20235d7
...
...
@@ -4,11 +4,13 @@ import sys
# I don't like it either. Just look the other way. :)
for
package
in
(
'urllib3'
,
'idna'
,
'chardet'
):
locals
()[
package
]
=
__import__
(
"pip._vendor."
+
package
)
vendored_package
=
"pip._vendor."
+
package
locals
()[
package
]
=
__import__
(
vendored_package
)
# This traversal is apparently necessary such that the identities are
# preserved (requests.packages.urllib3.* is urllib3.*)
for
mod
in
list
(
sys
.
modules
):
if
mod
==
package
or
mod
.
startswith
(
package
+
'.'
):
sys
.
modules
[
'requests.packages.'
+
mod
]
=
sys
.
modules
[
mod
]
if
mod
==
vendored_package
or
mod
.
startswith
(
vendored_package
+
'.'
):
unprefixed_mod
=
mod
[
len
(
"pip._vendor."
):]
sys
.
modules
[
'pip._vendor.requests.packages.'
+
unprefixed_mod
]
=
sys
.
modules
[
mod
]
# Kinda cool, though, right?
tasks/vendoring/patches/requests.patch
浏览文件 @
b20235d7
diff --git a/src/pip/_vendor/requests/packages.py b/src/pip/_vendor/requests/packages.py
index
7232fe0f..6336a07d
100644
index
6336a07d..9582fa73
100644
--- a/src/pip/_vendor/requests/packages.py
+++ b/src/pip/_vendor/requests/packages.py
@@ -4,
7 +4,7
@@
import sys
@@ -4,
11 +4,13
@@
import sys
# I don't like it either. Just look the other way. :)
for package in ('urllib3', 'idna', 'chardet'):
- locals()[package] = __import__(package)
+ locals()[package] = __import__("pip._vendor." + package)
+ vendored_package = "pip._vendor." + package
+ locals()[package] = __import__(vendored_package)
# This traversal is apparently necessary such that the identities are
# preserved (requests.packages.urllib3.* is urllib3.*)
for mod in list(sys.modules):
- if mod == package or mod.startswith(package + '.'):
- sys.modules['requests.packages.' + mod] = sys.modules[mod]
+ if mod == vendored_package or mod.startswith(vendored_package + '.'):
+ unprefixed_mod = mod[len("pip._vendor."):]
+ sys.modules['pip._vendor.requests.packages.' + unprefixed_mod] = sys.modules[mod]
# Kinda cool, though, right?
diff --git a/src/pip/_vendor/requests/__init__.py b/src/pip/_vendor/requests/__init__.py
index 9c3b769..44f6836 100644
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录