diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2018-05-18 14:09:07 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-05-18 14:09:07 -0400 |
| commit | 811c4feac09125d6946c6a159557c4e610fa58de (patch) | |
| tree | d3e91d0e96220621e5bc6f39a650530eb02d9b80 /pkg_resources/__init__.py | |
| parent | 5749b9cfb5ac231aa25d9b8b6a1a49994858aca4 (diff) | |
| parent | 58ad1e140703a9214b63e120113a17d48142dc8a (diff) | |
| download | python-setuptools-git-811c4feac09125d6946c6a159557c4e610fa58de.tar.gz | |
Merge pull request #1364 from seawolf42/feature/issue-1330
Feature/issue 1330
Diffstat (limited to 'pkg_resources/__init__.py')
| -rw-r--r-- | pkg_resources/__init__.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py index dbdc9b04..4e4409b3 100644 --- a/pkg_resources/__init__.py +++ b/pkg_resources/__init__.py @@ -2663,6 +2663,19 @@ class Distribution(object): raise AttributeError(attr) return getattr(self._provider, attr) + def __dir__(self): + return list( + set(super(Distribution, self).__dir__()) + | set( + attr for attr in self._provider.__dir__() + if not attr.startswith('_') + ) + ) + + if not hasattr(object, '__dir__'): + # python 2.7 not supported + del __dir__ + @classmethod def from_filename(cls, filename, metadata=None, **kw): return cls.from_location( |
