Skip to content

Commit

Permalink
use stdlib instead of backports after 3.8
Browse files Browse the repository at this point in the history
Summary:
Later was built on backports from 3.8 to give us features even while using 3.7.
When we moved to 3.8 we kept them because I wasn't exactly sure at the time that all the fixes we baked into 3.8 async_mock had made it into the stdlib 3.8 yet.

Well if the version of python is greater than 3.8 lets just use the stdlib

Bumping version so we can release to pypi

Differential Revision: D43885595

fbshipit-source-id: d5e1ca89984b818c512cea48e9dee0ebc9040b3a
  • Loading branch information
fried authored and facebook-github-bot committed Mar 8, 2023
1 parent cf4b8c2 commit 016532c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion later/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from .task import as_task, cancel, START_TASK, Watcher, WatcherError


__version__ = "22.11.1"
__version__ = "23.03.1"
__all__ = [
"BiDirectionalEvent",
"START_TASK",
Expand Down
6 changes: 5 additions & 1 deletion later/unittest/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@
from functools import wraps
from typing import Any, Callable, TypeVar

from .backport.async_case import IsolatedAsyncioTestCase as AsyncioTestCase

if sys.version_info[:2] >= (3, 9): # pragma: nocover
from unittest import IsolatedAsyncioTestCase as AsyncioTestCase
else: # pragma: nocover
from .backport.async_case import IsolatedAsyncioTestCase as AsyncioTestCase


_F = TypeVar("_F", bound=Callable[..., Any])
Expand Down
7 changes: 6 additions & 1 deletion later/unittest/mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@
# under the License.
from __future__ import annotations

import sys

from typing import Any
from unittest.mock import call, DEFAULT

from .backport.mock import AsyncMock, create_autospec, MagicMock, Mock, patch
if sys.version_info >= (3, 9): # pragma: nocover
from unittest.mock import AsyncMock, create_autospec, MagicMock, Mock, patch
else: # pragma: nocover
from .backport.mock import AsyncMock, create_autospec, MagicMock, Mock, patch


__all__ = [
Expand Down

0 comments on commit 016532c

Please sign in to comment.