Skip to content

Commit d7c816c

Browse files
authored
remove code that's no longer required that 3.7 is our minimum (#351)
1 parent 1899613 commit d7c816c

File tree

1 file changed

+1
-32
lines changed

1 file changed

+1
-32
lines changed

certifi/core.py

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def where() -> str:
4646
def contents() -> str:
4747
return files("certifi").joinpath("cacert.pem").read_text(encoding="ascii")
4848

49-
elif sys.version_info >= (3, 7):
49+
else:
5050

5151
from importlib.resources import path as get_path, read_text
5252

@@ -81,34 +81,3 @@ def where() -> str:
8181

8282
def contents() -> str:
8383
return read_text("certifi", "cacert.pem", encoding="ascii")
84-
85-
else:
86-
import os
87-
import types
88-
from typing import Union
89-
90-
Package = Union[types.ModuleType, str]
91-
Resource = Union[str, "os.PathLike"]
92-
93-
# This fallback will work for Python versions prior to 3.7 that lack the
94-
# importlib.resources module but relies on the existing `where` function
95-
# so won't address issues with environments like PyOxidizer that don't set
96-
# __file__ on modules.
97-
def read_text(
98-
package: Package,
99-
resource: Resource,
100-
encoding: str = 'utf-8',
101-
errors: str = 'strict'
102-
) -> str:
103-
with open(where(), encoding=encoding) as data:
104-
return data.read()
105-
106-
# If we don't have importlib.resources, then we will just do the old logic
107-
# of assuming we're on the filesystem and munge the path directly.
108-
def where() -> str:
109-
f = os.path.dirname(__file__)
110-
111-
return os.path.join(f, "cacert.pem")
112-
113-
def contents() -> str:
114-
return read_text("certifi", "cacert.pem", encoding="ascii")

0 commit comments

Comments
 (0)