Fix old file() alias for open()

Change-Id: Icebfa5b2fb0c972be0324d18824523ba0e30aaab
This commit is contained in:
Ian Wienand 2021-06-01 12:44:15 +10:00
parent 128dcb85a8
commit 79d7c6e5f3
4 changed files with 4 additions and 4 deletions

@ -38,7 +38,7 @@ class MeetBotTestCase(ChannelPluginTestCase):
plugins = ('MeetBot',)
def testRunMeeting(self):
test_script = file(os.path.join("test-script-2.log.txt"))
test_script = open(os.path.join("test-script-2.log.txt"))
for line in test_script:
# Normalize input lines somewhat.
line = line.strip()

@ -742,7 +742,7 @@ if __name__ == '__main__':
M = Meeting(channel=channel, owner=None,
filename=filename, writeRawLog=False)
for line in file(sys.argv[2]):
for line in open(sys.argv[2]):
# match regular spoken lines:
m = logline_re.match(line)
if m:

@ -323,7 +323,7 @@ class _CSSmanager(object):
# Stylesheet specified
if getattr(self.M.config, 'cssEmbed_'+name, True):
# external stylesheet
css = file(css_fname).read()
css = open(css_fname).read()
return self._css_head%css
else:
# linked stylesheet

@ -100,7 +100,7 @@ class MeetBotTest(unittest.TestCase):
"""
tmpdir = tempfile.mkdtemp(prefix='test-meetbot')
try:
process_meeting(contents=file('test-script-1.log.txt').read(),
process_meeting(contents=open('test-script-1.log.txt').read(),
filename=os.path.join(tmpdir, 'meeting'),
dontSave=False,
extraConfig={'writer_map':self.full_writer_map,