configfile: Improve support for python3.12
It seems python3.12 has removed support for readfp() - use read_file() instead. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
3c8f202dfa
commit
187cc2f1b8
|
@ -217,7 +217,10 @@ class PrinterConfig:
|
||||||
data = '\n'.join(buffer)
|
data = '\n'.join(buffer)
|
||||||
del buffer[:]
|
del buffer[:]
|
||||||
sbuffer = io.StringIO(data)
|
sbuffer = io.StringIO(data)
|
||||||
fileconfig.readfp(sbuffer, filename)
|
if sys.version_info.major >= 3:
|
||||||
|
fileconfig.read_file(sbuffer, filename)
|
||||||
|
else:
|
||||||
|
fileconfig.readfp(sbuffer, filename)
|
||||||
def _resolve_include(self, source_filename, include_spec, fileconfig,
|
def _resolve_include(self, source_filename, include_spec, fileconfig,
|
||||||
visited):
|
visited):
|
||||||
dirname = os.path.dirname(source_filename)
|
dirname = os.path.dirname(source_filename)
|
||||||
|
|
Loading…
Reference in New Issue