mirror of https://github.com/pypa/pip
Fixes to vendoring scripts so they work on Windows
This commit is contained in:
parent
277bd6b00b
commit
c822b765b5
|
@ -0,0 +1,2 @@
|
|||
# Patches must have Unix-style line endings, even on Windows
|
||||
tasks/vendoring/patches/* eol=lf
|
|
@ -73,7 +73,7 @@ def rewrite_imports(package_dir, vendored_libs):
|
|||
|
||||
def rewrite_file_imports(item, vendored_libs):
|
||||
"""Rewrite 'import xxx' and 'from xxx import' for vendored_libs"""
|
||||
text = item.read_text()
|
||||
text = item.read_text(encoding='utf-8')
|
||||
# Revendor pkg_resources.extern first
|
||||
text = re.sub(r'pkg_resources.extern', r'pip._vendor', text)
|
||||
for lib in vendored_libs:
|
||||
|
@ -87,7 +87,7 @@ def rewrite_file_imports(item, vendored_libs):
|
|||
r'\1from pip._vendor.%s' % lib,
|
||||
text,
|
||||
)
|
||||
item.write_text(text)
|
||||
item.write_text(text, encoding='utf-8')
|
||||
|
||||
|
||||
def apply_patch(ctx, patch_file_path):
|
||||
|
|
Loading…
Reference in New Issue