@@ -46,7 +46,7 @@ def where() -> str:
46
46
def contents () -> str :
47
47
return files ("certifi" ).joinpath ("cacert.pem" ).read_text (encoding = "ascii" )
48
48
49
- elif sys . version_info >= ( 3 , 7 ) :
49
+ else :
50
50
51
51
from importlib .resources import path as get_path , read_text
52
52
@@ -81,34 +81,3 @@ def where() -> str:
81
81
82
82
def contents () -> str :
83
83
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