Skip to content

Commit 96cc328

Browse files
committed
Remove Python 2 compatibility code
1 parent eb839a6 commit 96cc328

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

importlib_metadata/__init__.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import io
21
import os
32
import re
43
import abc
@@ -122,11 +121,7 @@ def _from_text(cls, text):
122121
config = ConfigParser(delimiters='=')
123122
# case sensitive: https://stackoverflow.com/q/1611799/812183
124123
config.optionxform = str
125-
try:
126-
config.read_string(text)
127-
except AttributeError: # pragma: nocover
128-
# Python 2 has no read_string
129-
config.readfp(io.StringIO(text))
124+
config.read_string(text)
130125
return EntryPoint._from_config(config)
131126

132127
def __iter__(self):

0 commit comments

Comments
 (0)