Skip to content

Commit

Permalink
fix deprecated readfp method of configparser
Browse files Browse the repository at this point in the history
  • Loading branch information
MostlyKIGuess authored and chimosky committed Jan 20, 2025
1 parent bd9616e commit a3f9d76
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/sugar3/bundle/activitybundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def _parse_info(self, info_file):
if six.PY2:
cp.readfp(info_file)
else:
cp.read_string(info_file.read().decode())
cp.read_file(info_file)

section = 'Activity'

Expand Down Expand Up @@ -258,7 +258,7 @@ def _parse_linfo(self, linfo_file):
if six.PY2:
cp.readfp(linfo_file)
else:
cp.read_string(linfo_file.read().decode())
cp.read_file(linfo_file)
except ParsingError as e:
logging.exception('Exception reading linfo file: %s', e)
return
Expand Down
2 changes: 1 addition & 1 deletion src/sugar3/bundle/contentbundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def __init__(self, path):

def _parse_info(self, info_file):
cp = ConfigParser()
cp.readfp(info_file)
cp.read_file(info_file)

section = 'Library'

Expand Down
2 changes: 1 addition & 1 deletion src/sugar3/graphics/icon.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ def _get_attach_points(self, info, size_request):
try:
with open(icon_filename) as config_file:
cp = ConfigParser()
cp.readfp(config_file)
cp.read_file(config_file)
attach_points_str = cp.get('Icon Data', 'AttachPoints')
attach_points = attach_points_str.split(',')
attach_x = float(attach_points[0].strip()) / 1000
Expand Down

0 comments on commit a3f9d76

Please sign in to comment.