File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -109,12 +109,14 @@ def _parse_cli(*ids: str) -> List[Tokens]:
109
109
>>> parse_back('//cycle')
110
110
Traceback (most recent call last):
111
111
InputError: Relative reference must follow an incomplete one.
112
- E.G: workflow //cycle/task
113
112
114
113
>>> parse_back('workflow//cycle', '//cycle')
115
114
Traceback (most recent call last):
116
115
InputError: Relative reference must follow an incomplete one.
117
- E.G: workflow //cycle/task
116
+
117
+ >>> parse_back('workflow///cycle/')
118
+ Traceback (most recent call last):
119
+ InputError: Invalid ID: workflow///cycle/
118
120
119
121
"""
120
122
# upgrade legacy ids if required
@@ -130,7 +132,11 @@ def _parse_cli(*ids: str) -> List[Tokens]:
130
132
if id_ .endswith ('/' ) and not id_ .endswith ('//' ): # noqa: SIM106
131
133
# tolerate IDs that end in a single slash on the CLI
132
134
# (e.g. CLI auto completion)
133
- tokens = Tokens (id_ [:- 1 ])
135
+ try :
136
+ # this ID is invalid with or without the trailing slash
137
+ tokens = Tokens (id_ [:- 1 ])
138
+ except ValueError :
139
+ raise InputError (f'Invalid ID: { id_ } ' )
134
140
else :
135
141
raise InputError (f'Invalid ID: { id_ } ' )
136
142
is_partial = tokens .get ('workflow' ) and not tokens .get ('cycle' )
You can’t perform that action at this time.
0 commit comments