File tree 2 files changed +15
-3
lines changed
2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -164,9 +164,9 @@ def parse_import_from(self) -> Node:
164
164
165
165
# Build the list of beginning relative tokens.
166
166
relative = 0
167
- while self .current_str () == "." :
168
- self .expect ( '.' )
169
- relative += 1
167
+ while self .current_str () in ( "." , "..." ) :
168
+ relative += len ( self .current_str () )
169
+ self . skip ()
170
170
171
171
# Parse qualified name to actually import from.
172
172
if self .current_str () == "import" :
Original file line number Diff line number Diff line change @@ -3169,3 +3169,15 @@ MypyFile:1(
3169
3169
z))
3170
3170
Block:1(
3171
3171
PassStmt:1())))
3172
+
3173
+ [case testRelativeImportWithEllipsis]
3174
+ from ... import x
3175
+ [out]
3176
+ MypyFile:1(
3177
+ ImportFrom:1(..., [x : x]))
3178
+
3179
+ [case testRelativeImportWithEllipsis2]
3180
+ from .... import x
3181
+ [out]
3182
+ MypyFile:1(
3183
+ ImportFrom:1(...., [x : x]))
You can’t perform that action at this time.
0 commit comments