Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
f8d00855
Commit
f8d00855
authored
Mar 31, 2009
by
Jesse Noller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge 70783 to py3k
parent
6d4a9cf8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
2 deletions
+9
-2
Lib/test/test_multiprocessing.py
Lib/test/test_multiprocessing.py
+4
-0
Misc/ACKS
Misc/ACKS
+1
-1
Misc/NEWS
Misc/NEWS
+3
-0
Modules/_multiprocessing/semaphore.c
Modules/_multiprocessing/semaphore.c
+1
-1
No files found.
Lib/test/test_multiprocessing.py
View file @
f8d00855
...
...
@@ -548,6 +548,10 @@ class _TestLock(BaseTestCase):
self
.
assertEqual
(
lock
.
release
(),
None
)
self
.
assertRaises
((
AssertionError
,
RuntimeError
),
lock
.
release
)
def
test_lock_context
(
self
):
with
self
.
Lock
():
pass
class
_TestSemaphore
(
BaseTestCase
):
...
...
Misc/ACKS
View file @
f8d00855
...
...
@@ -257,6 +257,7 @@ Dinu Gherman
Jonathan Giddy
Johannes Gijsbers
Michael Gilfix
Tim Golden
Chris Gonnerman
David Goodger
Hans de Graaff
...
...
@@ -794,4 +795,3 @@ Siebren van der Zee
Uwe Zessin
Tarek Ziad
Peter strand
Jesse Noller
Misc/NEWS
View file @
f8d00855
...
...
@@ -49,6 +49,9 @@ Core and Builtins
Library
-------
- Issue #5261: Patch multiprocessing's semaphore.c to support context
manager use: "with multiprocessing.Lock()" works now.
- Issue #5236: Change time.strptime() to only take strings. Didn't work with
bytes already but the failure was non-obvious.
...
...
Modules/_multiprocessing/semaphore.c
View file @
f8d00855
...
...
@@ -546,7 +546,7 @@ static PyMethodDef semlock_methods[] = {
"acquire the semaphore/lock"
},
{
"release"
,
(
PyCFunction
)
semlock_release
,
METH_NOARGS
,
"release the semaphore/lock"
},
{
"__enter__"
,
(
PyCFunction
)
semlock_acquire
,
METH_VARARG
S
,
{
"__enter__"
,
(
PyCFunction
)
semlock_acquire
,
METH_VARARGS
|
METH_KEYWORD
S
,
"enter the semaphore/lock"
},
{
"__exit__"
,
(
PyCFunction
)
semlock_release
,
METH_VARARGS
,
"exit the semaphore/lock"
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment