PYTHON-3078 Remove Use of Unsupported NoReturn Type Class (#864)

This commit is contained in:
Steven Silvester 2022-02-14 16:14:36 -06:00 committed by GitHub
parent 341d489f38
commit 2db512f5d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 5 deletions

View File

@ -1729,7 +1729,7 @@ tasks:
vars:
VERSION: "latest"
TOPOLOGY: "server"
PYTHON_BINARY: "/opt/mongodbtoolchain/v3/bin/python3"
PYTHON_BINARY: "/opt/mongodbtoolchain/v2/bin/python3"
- func: "run tests"
# }}}
- name: "coverage-report"

View File

@ -76,7 +76,6 @@ from typing import (
List,
Mapping,
MutableMapping,
NoReturn,
Sequence,
Tuple,
Type,
@ -167,7 +166,7 @@ def get_data_and_view(data: Any) -> Tuple[Any, memoryview]:
return view.tobytes(), view
def _raise_unknown_type(element_type: int, element_name: str) -> NoReturn:
def _raise_unknown_type(element_type: int, element_name: str) -> None:
"""Unknown type helper."""
raise InvalidBSON(
"Detected unknown BSON type %r for fieldname '%s'. Are "

View File

@ -24,7 +24,7 @@ import struct
import threading
import time
from random import SystemRandom
from typing import Any, NoReturn, Optional, Type, Union
from typing import Any, Optional, Type, Union
from bson.errors import InvalidId
from bson.tz_util import utc
@ -32,7 +32,7 @@ from bson.tz_util import utc
_MAX_COUNTER_VALUE = 0xFFFFFF
def _raise_invalid_id(oid: str) -> NoReturn:
def _raise_invalid_id(oid: str) -> None:
raise InvalidId(
"%r is not a valid ObjectId, it must be a 12-byte input"
" or a 24-character hex string" % oid