Skip to content

Commit

Permalink
Merge pull request pypa#10943 from pradyunsg/downgrade-distlib
Browse files Browse the repository at this point in the history
Downgrade to distlib 0.3.3
  • Loading branch information
pradyunsg committed Mar 6, 2022
1 parent 6c17e27 commit c149468
Show file tree
Hide file tree
Showing 20 changed files with 4,392 additions and 71 deletions.
1 change: 1 addition & 0 deletions news/distlib.vendor.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Downgrade distlib to 0.3.3.
2 changes: 1 addition & 1 deletion src/pip/_vendor/distlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#
import logging

__version__ = '0.3.4'
__version__ = '0.3.3'

class DistlibException(Exception):
pass
Expand Down
6 changes: 6 additions & 0 deletions src/pip/_vendor/distlib/_backport/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"""Modules copied from Python 3 standard libraries, for internal use only.
Individual classes and functions are found in d2._backport.misc. Intended
usage is to always import things missing from 3.1 from that module: the
built-in/stdlib objects will be used if found.
"""
41 changes: 41 additions & 0 deletions src/pip/_vendor/distlib/_backport/misc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
"""Backports for individual classes and functions."""

import os
import sys

__all__ = ['cache_from_source', 'callable', 'fsencode']


try:
from imp import cache_from_source
except ImportError:
def cache_from_source(py_file, debug=__debug__):
ext = debug and 'c' or 'o'
return py_file + ext


try:
callable = callable
except NameError:
from collections import Callable

def callable(obj):
return isinstance(obj, Callable)


try:
fsencode = os.fsencode
except AttributeError:
def fsencode(filename):
if isinstance(filename, bytes):
return filename
elif isinstance(filename, str):
return filename.encode(sys.getfilesystemencoding())
else:
raise TypeError("expect bytes or str, not %s" %
type(filename).__name__)
Loading

0 comments on commit c149468

Please sign in to comment.