Skip to content

Commit 58fb02c

Browse files
author
th3-j4ck4l
committed
Resolves #8627
1 parent d54fc8e commit 58fb02c

File tree

2 files changed

+50
-7
lines changed

2 files changed

+50
-7
lines changed

DEADJOE

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
2+
*** These modified files were found in JOE when it aborted on Mon Apr 6 19:35:46 2020
3+
*** JOE was aborted because the terminal closed
4+
5+
*** File '/tmp/mypy/.git/COMMIT_EDITMSG'
6+
# Please the commit message for your changes. Lines starting
7+
# with '#' will be ignored, and an empty message aborts the commit.
8+
#
9+
# On branch master
10+
# Your branch is up to date with 'origin/master'.
11+
#
12+
# Changes to be committed:
13+
# modified: mypy/fastparse.py
14+
#
15+
16+
*** File '(Unnamed)'
17+
/media/th3-j4ck4l/MEHMET G/taha/IkraDynamics-coreapi-6ee0fc6d3da6/code-anal/.git/COMMIT_EDITMSG
18+
/home/th3-j4ck4l/gitRepos/perv-notf/.git/COMMIT_EDITMSG
19+
/tmp/mypy/.git/COMMIT_EDITMSG
20+
21+
*** File '* Startup Log *'
22+
Processing '/etc/joe/editorrc'...
23+
Processing '/etc/joe/ftyperc'...
24+
Finished processing /etc/joe/ftyperc
25+
Finished processing /etc/joe/editorrc
26+
27+
*** These modified files were found in JOE when it aborted on Mon Apr 6 19:36:54 2020
28+
*** JOE was aborted because the terminal closed
29+
30+
*** File '(Unnamed)'
31+
/media/th3-j4ck4l/MEHMET G/taha/IkraDynamics-coreapi-6ee0fc6d3da6/code-anal/.git/COMMIT_EDITMSG
32+
/home/th3-j4ck4l/gitRepos/perv-notf/.git/COMMIT_EDITMSG
33+
/tmp/mypy/.git/COMMIT_EDITMSG
34+
35+
*** File '* Startup Log *'
36+
Processing '/etc/joe/editorrc'...
37+
Processing '/etc/joe/ftyperc'...
38+
Finished processing /etc/joe/ftyperc
39+
Finished processing /etc/joe/editorrc

mypy/fastparse.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1504,17 +1504,21 @@ def visit_Bytes(self, n: Bytes) -> Type:
15041504

15051505
# Subscript(expr value, slice slice, expr_context ctx)
15061506
def visit_Subscript(self, n: ast3.Subscript) -> Type:
1507-
if not isinstance(n.slice, Index):
1508-
self.fail(TYPE_COMMENT_SYNTAX_ERROR, self.line, getattr(n, 'col_offset', -1))
1509-
return AnyType(TypeOfAny.from_error)
1507+
if PY_MINOR_VERSION >= 9:
1508+
slice_value = n.slice
1509+
else:
1510+
if not isinstance(n.slice, Index):
1511+
self.fail(TYPE_COMMENT_SYNTAX_ERROR, self.line, getattr(n, 'col_offset', -1))
1512+
return AnyType(TypeOfAny.from_error)
1513+
slice_value = n.slice.value
15101514

15111515
empty_tuple_index = False
1512-
if isinstance(n.slice.value, ast3.Tuple):
1513-
params = self.translate_expr_list(n.slice.value.elts)
1514-
if len(n.slice.value.elts) == 0:
1516+
if isinstance(slice_value, ast3.Tuple):
1517+
params = self.translate_expr_list(slice_value.elts)
1518+
if len(slice_value.elts) == 0:
15151519
empty_tuple_index = True
15161520
else:
1517-
params = [self.visit(n.slice.value)]
1521+
params = [self.visit(slice_value)]
15181522

15191523
value = self.visit(n.value)
15201524
if isinstance(value, UnboundType) and not value.args:

0 commit comments

Comments
 (0)