cross port importlib-metadata PR #76 (#13903)

https://gitlab.com/python-devs/importlib_metadata/merge_requests/76
This commit is contained in:
Anthony Sottile 2019-06-07 14:23:39 -07:00 committed by Barry Warsaw
parent 03d5831a2d
commit 65e5860fcc
4 changed files with 4 additions and 0 deletions

View File

@ -89,6 +89,8 @@ class EntryPoint(collections.namedtuple('EntryPointBase', 'name value group')):
@classmethod @classmethod
def _from_text(cls, text): def _from_text(cls, text):
config = ConfigParser() config = ConfigParser()
# case sensitive: https://stackoverflow.com/q/1611799/812183
config.optionxform = str
try: try:
config.read_string(text) config.read_string(text)
except AttributeError: # pragma: nocover except AttributeError: # pragma: nocover

View File

@ -26,6 +26,8 @@ class TestZip(unittest.TestCase):
scripts = dict(entry_points()['console_scripts']) scripts = dict(entry_points()['console_scripts'])
entry_point = scripts['example'] entry_point = scripts['example']
self.assertEqual(entry_point.value, 'example:main') self.assertEqual(entry_point.value, 'example:main')
entry_point = scripts['Example']
self.assertEqual(entry_point.value, 'example:main')
def test_missing_metadata(self): def test_missing_metadata(self):
self.assertIsNone(distribution('example').read_text('does not exist')) self.assertIsNone(distribution('example').read_text('does not exist'))