From cb00cf20ad0c9a3817c6a679fd204dda5a8d3c52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20Veres-Szentkir=C3=A1lyi?= Date: Mon, 6 Nov 2023 08:28:13 +0100 Subject: [PATCH] codegen.py: use open() instead of file() --- pysstv/examples/codegen.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pysstv/examples/codegen.py b/pysstv/examples/codegen.py index ee0aba5..777b026 100644 --- a/pysstv/examples/codegen.py +++ b/pysstv/examples/codegen.py @@ -138,12 +138,12 @@ def test(img_file): assert gen[n * 8:(n + 1) * 8] == struct.pack('ff', freq, msec) except AssertionError: mode_name = sstv_class.__name__ - with file('/tmp/{0}-c.bin'.format(mode_name), 'wb') as f: + with open('/tmp/{0}-c.bin'.format(mode_name), 'wb') as f: f.write(gen) - with file('/tmp/{0}-py.bin'.format(mode_name), 'wb') as f: + with open('/tmp/{0}-py.bin'.format(mode_name), 'wb') as f: for n, (freq, msec) in enumerate(sstv.gen_freq_bits()): f.write(struct.pack('ff', freq, msec)) - with file('/tmp/{0}.c'.format(mode_name), 'w') as f: + with open('/tmp/{0}.c'.format(mode_name), 'w') as f: f.write(c_src) print((" ! Outputs are different, they've been saved to " "/tmp/{0}-{{c,py}}.bin, along with the C source code "