Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#382)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/asottile/pyupgrade: v2.31.0 → v2.31.1](asottile/pyupgrade@v2.31.0...v2.31.1)
- [github.com/asottile/pyupgrade: v2.31.0 → v2.31.1](asottile/pyupgrade@v2.31.0...v2.31.1)
- [github.com/pre-commit/mirrors-mypy: v0.931 → v0.940](pre-commit/mirrors-mypy@v0.931...v0.940)

* remove type ignore

* fix typing

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Talley Lambert <talley.lambert@gmail.com>
  • Loading branch information
pre-commit-ci[bot] and tlambert03 committed Mar 18, 2022
1 parent 9c65b23 commit c4f563e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/asottile/pyupgrade
rev: v2.31.0
rev: v2.31.1
hooks:
- id: pyupgrade
- repo: https://github.com/myint/autoflake
Expand All @@ -18,7 +18,7 @@ repos:
hooks:
- id: isort
- repo: https://github.com/asottile/pyupgrade
rev: v2.31.0
rev: v2.31.1
hooks:
- id: pyupgrade
args: ["--py37-plus", "--keep-runtime-typing"]
Expand All @@ -34,7 +34,7 @@ repos:
pass_filenames: true
exclude: (examples|_mpl_image)
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.931
rev: v0.940
hooks:
- id: mypy
additional_dependencies: [tokenize-rt==3.2.0]
Expand Down
6 changes: 3 additions & 3 deletions magicgui/_type_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,10 +376,10 @@ def resolve_annotation(
annotation = type(None)

if isinstance(annotation, str):
kwargs = dict(is_argument=False)
if (3, 10) > sys.version_info >= (3, 9, 8) or sys.version_info >= (3, 10, 1):
annotation = ForwardRef(annotation, is_argument=False, is_class=True)
else:
annotation = ForwardRef(annotation, is_argument=False)
kwargs["is_class"] = True
annotation = ForwardRef(annotation, **kwargs)

try:
return _eval_type(annotation, namespace, None)
Expand Down

0 comments on commit c4f563e

Please sign in to comment.