Commit 65e5860f authored by Anthony Sottile's avatar Anthony Sottile Committed by Barry Warsaw

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

https://gitlab.com/python-devs/importlib_metadata/merge_requests/76
parent 03d5831a
...@@ -89,6 +89,8 @@ class EntryPoint(collections.namedtuple('EntryPointBase', 'name value group')): ...@@ -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
......
...@@ -26,6 +26,8 @@ class TestZip(unittest.TestCase): ...@@ -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'))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment