Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

call_later should always return TimerHandle#704

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
jensbjorgensen wants to merge2 commits intoMagicStack:master
base:master
Choose a base branch
Loading
fromjensbjorgensen:master
Open
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletionstests/test_base.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -938,6 +938,12 @@ def test_loop_call_later_handle_when_after_fired(self):
self.loop.run_until_complete(fut)
self.assertEqual(handle.when(), when)

def test_loop_call_later_0_returns_timer_handle(self):
cb = lambda: False # NoQA
handle = self.loop.call_later(0, cb)
handle.when()
handle.cancel()


class TestBaseAIO(_TestBase, AIOTestCase):
pass
Expand Down
5 changes: 1 addition & 4 deletionsuvloop/loop.pyx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1326,10 +1326,7 @@ cdef class Loop:
when = <uint64_t>round(delay * 1000)
if not args:
args = None
if when == 0:
return self._call_soon(callback, args, context)
else:
return self._call_later(when, callback, args, context)
return self._call_later(when, callback, args, context)

def call_at(self, when, callback, *args, context=None):
"""Like call_later(), but uses an absolute time.
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp