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
7264e92b
Commit
7264e92b
authored
Sep 11, 2019
by
Andrew Svetlov
Committed by
Miss Islington (bot)
Sep 11, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-36373: Fix deprecation warnings (GH-15889)
https://bugs.python.org/issue36373
parent
efd5741a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
12 deletions
+12
-12
Lib/asyncio/locks.py
Lib/asyncio/locks.py
+1
-1
Lib/asyncio/queues.py
Lib/asyncio/queues.py
+1
-1
Lib/test/test_asyncio/test_locks.py
Lib/test/test_asyncio/test_locks.py
+3
-4
Lib/test/test_asyncio/test_queues.py
Lib/test/test_asyncio/test_queues.py
+1
-2
Lib/unittest/async_case.py
Lib/unittest/async_case.py
+6
-4
No files found.
Lib/asyncio/locks.py
View file @
7264e92b
...
@@ -332,7 +332,7 @@ class Condition(_ContextManagerMixin):
...
@@ -332,7 +332,7 @@ class Condition(_ContextManagerMixin):
DeprecationWarning
,
stacklevel
=
2
)
DeprecationWarning
,
stacklevel
=
2
)
if
lock
is
None
:
if
lock
is
None
:
lock
=
Lock
(
loop
=
self
.
_
loop
)
lock
=
Lock
(
loop
=
loop
)
elif
lock
.
_loop
is
not
self
.
_loop
:
elif
lock
.
_loop
is
not
self
.
_loop
:
raise
ValueError
(
"loop argument must agree with lock"
)
raise
ValueError
(
"loop argument must agree with lock"
)
...
...
Lib/asyncio/queues.py
View file @
7264e92b
...
@@ -45,7 +45,7 @@ class Queue:
...
@@ -45,7 +45,7 @@ class Queue:
# Futures.
# Futures.
self
.
_putters
=
collections
.
deque
()
self
.
_putters
=
collections
.
deque
()
self
.
_unfinished_tasks
=
0
self
.
_unfinished_tasks
=
0
self
.
_finished
=
locks
.
Event
(
loop
=
self
.
_
loop
)
self
.
_finished
=
locks
.
Event
(
loop
=
loop
)
self
.
_finished
.
set
()
self
.
_finished
.
set
()
self
.
_init
(
maxsize
)
self
.
_init
(
maxsize
)
...
...
Lib/test/test_asyncio/test_locks.py
View file @
7264e92b
...
@@ -500,10 +500,9 @@ class ConditionTests(test_utils.TestCase):
...
@@ -500,10 +500,9 @@ class ConditionTests(test_utils.TestCase):
self
.
assertIs
(
cond
.
_loop
,
self
.
loop
)
self
.
assertIs
(
cond
.
_loop
,
self
.
loop
)
def
test_ctor_noloop
(
self
):
def
test_ctor_noloop
(
self
):
with
self
.
assertWarns
(
DeprecationWarning
):
asyncio
.
set_event_loop
(
self
.
loop
)
asyncio
.
set_event_loop
(
self
.
loop
)
cond
=
asyncio
.
Condition
()
cond
=
asyncio
.
Condition
()
self
.
assertIs
(
cond
.
_loop
,
self
.
loop
)
self
.
assertIs
(
cond
.
_loop
,
self
.
loop
)
def
test_wait
(
self
):
def
test_wait
(
self
):
with
self
.
assertWarns
(
DeprecationWarning
):
with
self
.
assertWarns
(
DeprecationWarning
):
...
...
Lib/test/test_asyncio/test_queues.py
View file @
7264e92b
...
@@ -83,8 +83,7 @@ class QueueBasicTests(_QueueTestBase):
...
@@ -83,8 +83,7 @@ class QueueBasicTests(_QueueTestBase):
def
test_ctor_noloop
(
self
):
def
test_ctor_noloop
(
self
):
asyncio
.
set_event_loop
(
self
.
loop
)
asyncio
.
set_event_loop
(
self
.
loop
)
with
self
.
assertWarns
(
DeprecationWarning
):
q
=
asyncio
.
Queue
()
q
=
asyncio
.
Queue
()
self
.
assertIs
(
q
.
_loop
,
self
.
loop
)
self
.
assertIs
(
q
.
_loop
,
self
.
loop
)
def
test_repr
(
self
):
def
test_repr
(
self
):
...
...
Lib/unittest/async_case.py
View file @
7264e92b
...
@@ -89,8 +89,9 @@ class IsolatedAsyncioTestCase(TestCase):
...
@@ -89,8 +89,9 @@ class IsolatedAsyncioTestCase(TestCase):
else
:
else
:
return
ret
return
ret
async
def
_asyncioLoopRunner
(
self
):
async
def
_asyncioLoopRunner
(
self
,
fut
):
queue
=
self
.
_asyncioCallsQueue
self
.
_asyncioCallsQueue
=
queue
=
asyncio
.
Queue
()
fut
.
set_result
(
None
)
while
True
:
while
True
:
query
=
await
queue
.
get
()
query
=
await
queue
.
get
()
queue
.
task_done
()
queue
.
task_done
()
...
@@ -113,8 +114,9 @@ class IsolatedAsyncioTestCase(TestCase):
...
@@ -113,8 +114,9 @@ class IsolatedAsyncioTestCase(TestCase):
asyncio
.
set_event_loop
(
loop
)
asyncio
.
set_event_loop
(
loop
)
loop
.
set_debug
(
True
)
loop
.
set_debug
(
True
)
self
.
_asyncioTestLoop
=
loop
self
.
_asyncioTestLoop
=
loop
self
.
_asyncioCallsQueue
=
asyncio
.
Queue
(
loop
=
loop
)
fut
=
loop
.
create_future
()
self
.
_asyncioCallsTask
=
loop
.
create_task
(
self
.
_asyncioLoopRunner
())
self
.
_asyncioCallsTask
=
loop
.
create_task
(
self
.
_asyncioLoopRunner
(
fut
))
loop
.
run_until_complete
(
fut
)
def
_tearDownAsyncioLoop
(
self
):
def
_tearDownAsyncioLoop
(
self
):
assert
self
.
_asyncioTestLoop
is
not
None
assert
self
.
_asyncioTestLoop
is
not
None
...
...
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