File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1288,9 +1288,7 @@ init 200 python in mas_dockstat:
12881288 return True
12891289
12901290 except Exception as e:
1291- log.write(
1292- " [ERROR] : failed to pickle data: {0} " .format(repr (e))
1293- )
1291+ log.write(f " [ERROR] : failed to pickle data: {e!r} " )
12941292 return False
12951293
12961294
@@ -1481,14 +1479,13 @@ init 200 python in mas_dockstat:
14811479 _buildMetaDataList(moni_buffer)
14821480
14831481 # ## monikachr
1484- moni_chr = None
14851482 try :
1486- moni_chr = open (os.path.normcase (
1487- renpy.config.basedir + " /game/mod_assets/monika/mbase"
1488- ), " rb" )
1489-
1490- # NOTE: moin_chr is going to be less than 200KB, this be fine
1491- moni_buffer.write(moni_chr.read().decode(" utf-8" ))
1483+ with open (
1484+ os.path.normcase( renpy.config.basedir + " /game/mod_assets/monika/mbase" ),
1485+ " rb" ,
1486+ ) as moni_chr:
1487+ # NOTE: moin_chr is going to be less than 200KB, this be fine
1488+ moni_buffer.write(moni_chr.read().decode(" utf-8" ))
14921489
14931490 except Exception as e:
14941491 cr_log.error(" mbase copy failed | {0} " .format(
@@ -1497,11 +1494,6 @@ init 200 python in mas_dockstat:
14971494 moni_buffer.close()
14981495 return False
14991496
1500- finally :
1501- # always close moni_chr
1502- if moni_chr is not None :
1503- moni_chr.close()
1504-
15051497 # ## now we must do the streamlined write system to file
15061498 moni_path = dockstat._trackPackage(" monika" )
15071499 moni_fbuffer = None
You can’t perform that action at this time.
0 commit comments