Skip to content

Commit

Permalink
Update to python 3.12 (#636)
Browse files Browse the repository at this point in the history
* Fix

* Use read_file instead of read
  • Loading branch information
kilmanio authored Oct 11, 2023
1 parent f15a87f commit 7456a94
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions syncplay/ui/ConfigurationGetter.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import re
import os
import sys
from configparser import SafeConfigParser, DEFAULTSECT
from configparser import ConfigParser, DEFAULTSECT

from syncplay import constants, utils, version, milestone
from syncplay.messages import getMessage, setLanguage, isValidLanguage
Expand Down Expand Up @@ -389,7 +389,7 @@ def _parseConfigFile(self, iniPath, createConfig=True):
open(iniPath, 'w').close()
else:
return
parser.readfp(codecs.open(iniPath, "r", "utf_8_sig"))
parser.read_file(codecs.open(iniPath, "r", "utf_8_sig"))
for section, options in list(self._iniStructure.items()):
if parser.has_section(section):
for option in options:
Expand Down Expand Up @@ -432,7 +432,7 @@ def _saveConfig(self, iniPath):
if self._config['noStore']:
return
parser = SafeConfigParserUnicode(strict=False)
parser.readfp(codecs.open(iniPath, "r", "utf_8_sig"))
parser.read_file(codecs.open(iniPath, "r", "utf_8_sig"))
for section, options in list(self._iniStructure.items()):
if not parser.has_section(section):
parser.add_section(section)
Expand Down Expand Up @@ -593,7 +593,7 @@ def setConfigOption(self, option, value):
self._config = backup


class SafeConfigParserUnicode(SafeConfigParser):
class SafeConfigParserUnicode(ConfigParser):
def write(self, fp):
"""Write an .ini-format representation of the configuration state."""
if self._defaults:
Expand Down

0 comments on commit 7456a94

Please sign in to comment.