Skip to content

Commit a3f9d76

Browse files
MostlyKIGuesschimosky
authored andcommitted
fix deprecated readfp method of configparser
1 parent bd9616e commit a3f9d76

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/sugar3/bundle/activitybundle.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def _parse_info(self, info_file):
133133
if six.PY2:
134134
cp.readfp(info_file)
135135
else:
136-
cp.read_string(info_file.read().decode())
136+
cp.read_file(info_file)
137137

138138
section = 'Activity'
139139

@@ -258,7 +258,7 @@ def _parse_linfo(self, linfo_file):
258258
if six.PY2:
259259
cp.readfp(linfo_file)
260260
else:
261-
cp.read_string(linfo_file.read().decode())
261+
cp.read_file(linfo_file)
262262
except ParsingError as e:
263263
logging.exception('Exception reading linfo file: %s', e)
264264
return

src/sugar3/bundle/contentbundle.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def __init__(self, path):
6868

6969
def _parse_info(self, info_file):
7070
cp = ConfigParser()
71-
cp.readfp(info_file)
71+
cp.read_file(info_file)
7272

7373
section = 'Library'
7474

src/sugar3/graphics/icon.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def _get_attach_points(self, info, size_request):
214214
try:
215215
with open(icon_filename) as config_file:
216216
cp = ConfigParser()
217-
cp.readfp(config_file)
217+
cp.read_file(config_file)
218218
attach_points_str = cp.get('Icon Data', 'AttachPoints')
219219
attach_points = attach_points_str.split(',')
220220
attach_x = float(attach_points[0].strip()) / 1000

0 commit comments

Comments
 (0)