diff --git a/ts2panda/scripts/generate_plugin.py b/ts2panda/scripts/generate_plugin.py index 7b3e660db281b185aaa48fdda7fd781eee3451f3..0f7fe8e3dd59a070e541b11aa56b2f4d77466ccf 100755 --- a/ts2panda/scripts/generate_plugin.py +++ b/ts2panda/scripts/generate_plugin.py @@ -93,10 +93,10 @@ def gen_java_method(input_arguments): (out_dir, _) = os.path.split(input_arguments.generated_file) js_bin_file = os.path.join(out_dir, file_name_pre + JS_BIN_EXT) - flags = os.O_WRONLY | os.O_CREAT | os.EXCL + flags = os.O_WRONLY | os.O_CREAT | os.O_EXCL modes = stat.S_IWUSR | stat.S_IRUSR - with (os.fdopen(out_file, flags, modes), "w") as output: + with os.fdopen(os.open(out_file, flags, modes), "w") as output: output.write("/*%s * Generated from Java and JavaScript plugins by ts2abc.%s */%s%s" % (os.linesep, os.linesep, os.linesep, os.linesep))