aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/configfile.py
diff options
context:
space:
mode:
Diffstat (limited to 'klippy/configfile.py')
-rw-r--r--klippy/configfile.py17
1 files changed, 5 insertions, 12 deletions
diff --git a/klippy/configfile.py b/klippy/configfile.py
index 3ddfe0d3..e8ede0c3 100644
--- a/klippy/configfile.py
+++ b/klippy/configfile.py
@@ -3,7 +3,7 @@
# Copyright (C) 2016-2024 Kevin O'Connor <kevin@koconnor.net>
#
# This file may be distributed under the terms of the GNU GPLv3 license.
-import sys, os, glob, re, time, logging, configparser, io
+import os, glob, re, time, logging, configparser, io
error = configparser.Error
@@ -263,19 +263,12 @@ class ConfigFileReader:
if pos >= 0:
lines[i] = line[:pos]
sbuffer = io.StringIO("\n".join(lines))
- if sys.version_info.major >= 3:
- fileconfig.read_file(sbuffer, filename)
- else:
- fileconfig.readfp(sbuffer, filename)
+ fileconfig.read_file(sbuffer, filename)
def _create_fileconfig(self):
- if sys.version_info.major >= 3:
- fileconfig = configparser.RawConfigParser(
- strict=False, inline_comment_prefixes=(";", "#")
- )
- else:
- fileconfig = configparser.RawConfigParser()
- return fileconfig
+ return configparser.RawConfigParser(
+ strict=False, inline_comment_prefixes=(";", "#")
+ )
def build_fileconfig(self, data, filename):
fileconfig = self._create_fileconfig()