Skip to content

Commit ea109a0

Browse files
committed
Make magic use pkg_resources.iter_entry_points instead of relying on
egg_info.iter_entry_points, which might not be there if someone redefines egg_info (like the setup.py for pyobjc-core does) Fixes GH-11
1 parent 4c96de6 commit ea109a0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pip/req.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -245,14 +245,16 @@ def run_egg_info(self, force_root_egg_info=False):
245245
_run_setup_py = """
246246
__file__ = __SETUP_PY__
247247
from setuptools.command import egg_info
248+
import pkg_resources
249+
import os
248250
def replacement_run(self):
249251
self.mkpath(self.egg_info)
250252
installer = self.distribution.fetch_build_egg
251-
for ep in egg_info.iter_entry_points('egg_info.writers'):
253+
for ep in pkg_resources.iter_entry_points('egg_info.writers'):
252254
# require=False is the change we're making:
253255
writer = ep.load(require=False)
254256
if writer:
255-
writer(self, ep.name, egg_info.os.path.join(self.egg_info,ep.name))
257+
writer(self, ep.name, os.path.join(self.egg_info,ep.name))
256258
self.find_sources()
257259
egg_info.egg_info.run = replacement_run
258260
exec(compile(open(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec'))

0 commit comments

Comments
 (0)