Skip to content

Commit

Permalink
Fix it only one way
Browse files Browse the repository at this point in the history
MyPy can't handle a Pythonic try-except import: python/mypy#1393
We could put # type: ignore[attr-defined] except then whichever branch
actually passed on the currently installed version of the module would
fail due to having an apparently-unneeded ignore.
  • Loading branch information
adamnovak committed Jul 17, 2023
1 parent c2e1d10 commit d2b36ed
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/toil/lib/aws/iam.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@

import boto3
from mypy_boto3_iam import IAMClient
try:
from mypy_boto3_iam.type_defs import AttachedPolicyTypeDef
except ImportError:
# mypy_boto3_iam==1.28.3.post1 shipped this under a different name. It
# might move again in the future?
from mypy_boto3_iam.type_defs import AttachedPolicyOutputTypeDef as AttachedPolicyTypeDef
from mypy_boto3_iam.type_defs import AttachedPolicyTypeDef
from mypy_boto3_sts import STSClient

from toil.lib.aws import zone_to_region
Expand Down

0 comments on commit d2b36ed

Please sign in to comment.