diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2018-09-16 11:14:30 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-09-16 11:14:30 -0400 |
| commit | 9e23b6d3e046113e8546e9fe084c112e809af795 (patch) | |
| tree | 7d8d24b491122a6766cef2c6302e71512b22a37f | |
| parent | d00313856696b00710b8cf8052569d38c2536580 (diff) | |
| parent | 5f2cb7661d989e79b82c0df195e0c371fab3949f (diff) | |
| download | external_python_setuptools-9e23b6d3e046113e8546e9fe084c112e809af795.tar.gz external_python_setuptools-9e23b6d3e046113e8546e9fe084c112e809af795.tar.bz2 external_python_setuptools-9e23b6d3e046113e8546e9fe084c112e809af795.zip | |
Merge pull request #1324 from torsava/safe_name
Make safe_name compliant to PEP 503 and behaviour of pip > 8.1.2
| -rw-r--r-- | changelog.d/1324.change.rst | 1 | ||||
| -rw-r--r-- | pkg_resources/__init__.py | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/changelog.d/1324.change.rst b/changelog.d/1324.change.rst new file mode 100644 index 00000000..5c97dd2a --- /dev/null +++ b/changelog.d/1324.change.rst @@ -0,0 +1 @@ +Make safe_name compliant with PEP 503. diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py index fa1cba86..a8b5319f 100644 --- a/pkg_resources/__init__.py +++ b/pkg_resources/__init__.py @@ -1312,9 +1312,9 @@ def get_default_cache(): def safe_name(name): """Convert an arbitrary string to a standard distribution name - Any runs of non-alphanumeric/. characters are replaced with a single '-'. + Any runs of non-alphanumeric characters are replaced with a single '-'. """ - return re.sub('[^A-Za-z0-9.]+', '-', name) + return re.sub('[^A-Za-z0-9]+', '-', name) def safe_version(version): |
