summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Doc/library/multiprocessing.rst6
1 files changed, 4 insertions, 2 deletions
diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst
index 5fac730..2763398 100644
--- a/Doc/library/multiprocessing.rst
+++ b/Doc/library/multiprocessing.rst
@@ -262,8 +262,10 @@ that only one process prints to standard output at a time::
def f(l, i):
l.acquire()
- print('hello world', i)
- l.release()
+ try:
+ print('hello world', i)
+ finally:
+ l.release()
if __name__ == '__main__':
lock = Lock()