Skip to content

Commit

Permalink
PYTHON-3679 Support mypy 1.2 (#1194)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaneHarvey authored Apr 28, 2023
1 parent e75cfec commit bc9029a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
cache-dependency-path: 'setup.py'
- name: Install dependencies
run: |
python -m pip install -U pip mypy==0.990
python -m pip install -U pip mypy==1.2
pip install -e ".[zstd, encryption, ocsp]"
- name: Run mypy
run: |
Expand Down
2 changes: 1 addition & 1 deletion bson/decimal128.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def _decimal_to_128(value: _VALUE_OPTIONS) -> Tuple[int, int]:
if significand & (1 << i):
high |= 1 << (i - 64)

biased_exponent = exponent + _EXPONENT_BIAS
biased_exponent = exponent + _EXPONENT_BIAS # type: ignore[operator]

if high >> 49 == 1:
high = high & 0x7FFFFFFFFFFF
Expand Down
4 changes: 2 additions & 2 deletions bson/son.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def __init__(
self.update(kwargs)

def __new__(cls: Type["SON[_Key, _Value]"], *args: Any, **kwargs: Any) -> "SON[_Key, _Value]":
instance = super(SON, cls).__new__(cls, *args, **kwargs)
instance = super(SON, cls).__new__(cls, *args, **kwargs) # type: ignore[type-var]
instance.__keys = []
return instance

Expand Down Expand Up @@ -115,7 +115,7 @@ def clear(self) -> None:
self.__keys = []
super(SON, self).clear()

def setdefault(self, key: _Key, default: _Value) -> _Value: # type: ignore[override]
def setdefault(self, key: _Key, default: _Value) -> _Value:
try:
return self[key]
except KeyError:
Expand Down
2 changes: 1 addition & 1 deletion test/test_encryption.py
Original file line number Diff line number Diff line change
Expand Up @@ -2162,7 +2162,7 @@ def test_05_tlsDisableOCSPEndpointCheck_is_permitted(self):
self.addCleanup(encryption.close)
ctx = encryption._io_callbacks.opts._kms_ssl_contexts["aws"]
if not hasattr(ctx, "check_ocsp_endpoint"):
raise self.skipTest("OCSP not enabled") # type:ignore
raise self.skipTest("OCSP not enabled")
self.assertFalse(ctx.check_ocsp_endpoint)


Expand Down

0 comments on commit bc9029a

Please sign in to comment.