aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2021-01-17 22:46:04 -0500
committerKevin O'Connor <kevin@koconnor.net>2021-01-17 22:46:04 -0500
commit0e9cb2abac63a534b01741f7afa01499d5a6d0a8 (patch)
tree92e3a45355e5f7e9d1a2de55deb4c6871f53d74e
parentdac0fba50ddf10da6f30b4b7a4f5c7126e8aef9c (diff)
downloadkutter-0e9cb2abac63a534b01741f7afa01499d5a6d0a8.tar.gz
kutter-0e9cb2abac63a534b01741f7afa01499d5a6d0a8.tar.xz
kutter-0e9cb2abac63a534b01741f7afa01499d5a6d0a8.zip
save_variables: Import ConfigParser as configparser for better Python3 support
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r--klippy/extras/save_variables.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/klippy/extras/save_variables.py b/klippy/extras/save_variables.py
index 8a6e9bec..6c88e3cf 100644
--- a/klippy/extras/save_variables.py
+++ b/klippy/extras/save_variables.py
@@ -4,7 +4,7 @@
# Copyright (C) 2016-2020 Kevin O'Connor <kevin@koconnor.net>
#
# This file may be distributed under the terms of the GNU GPLv3 license.
-import os, logging, ast, ConfigParser
+import os, logging, ast, ConfigParser as configparser
class SaveVariables:
def __init__(self, config):
@@ -20,7 +20,7 @@ class SaveVariables:
desc=self.cmd_SAVE_VARIABLE_help)
def loadVariables(self):
allvars = {}
- varfile = ConfigParser.ConfigParser()
+ varfile = configparser.ConfigParser()
try:
varfile.read(self.filename)
if varfile.has_section('Variables'):
@@ -42,7 +42,7 @@ class SaveVariables:
newvars = dict(self.allVariables)
newvars[varname] = value
# Write file
- varfile = ConfigParser.ConfigParser()
+ varfile = configparser.ConfigParser()
varfile.add_section('Variables')
for name, val in sorted(newvars.items()):
varfile.set('Variables', name, repr(val))