Skip to content

Commit ce8f512

Browse files
Fix "Copy-Paste Camera" tool Python 3 compatibility issue.
Issue #217.
1 parent 3270594 commit ce8f512

File tree

1 file changed

+3
-3
lines changed
  • python/mmSolver/tools/copypastecamera

1 file changed

+3
-3
lines changed

python/mmSolver/tools/copypastecamera/lib.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -519,15 +519,15 @@ def write_temp_file(data_str):
519519
"""
520520
Write file.
521521
"""
522+
assert isinstance(data_str, pycompat.TEXT_TYPE)
522523
file_ext = const.EXT
523524
f = tempfile.NamedTemporaryFile(
524-
mode='w+b',
525+
mode='w',
525526
suffix=file_ext,
526527
delete=False
527528
)
528529
if f.closed:
529-
msg = "Error: Couldn't open file.\n%r"
530-
msg = msg % f.name
530+
LOG.error("Error: Couldn't open file.\n%r", f.name)
531531
return False
532532
f.write(data_str)
533533
f.close()

0 commit comments

Comments
 (0)