Skip to content

Commit 92fc961

Browse files
Yashp002picnixz
andauthored
Update Doc/library/sys.rst
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
1 parent eacadb1 commit 92fc961

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Doc/library/sys.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2007,12 +2007,15 @@ local and remote interpreters must be the same exact version.
20072007
import tempfile
20082008
import sys
20092009

2010-
with tempfile.NamedTemporaryFile(mode='w', suffix='.py', delete=False) as f:
2010+
with tempfile.NamedTemporaryFile(
2011+
mode='w',
2012+
suffix='.py',
2013+
delete_on_close=False,
2014+
) as f:
20112015
f.write("print('Hello from remote!')")
20122016
f.flush()
20132017
os.chmod(f.name, 0o644) # Readable by group/other
20142018
sys.remote_exec(pid, f.name)
2015-
os.unlink(f.name) # Cleanup
20162019

20172020
See :ref:`remote-debugging` for more information about the remote debugging
20182021
mechanism.

0 commit comments

Comments
 (0)