equal
deleted
inserted
replaced
276 raise error.InputError( |
276 raise error.InputError( |
277 _(b"%r cannot be used in a name") % pycompat.bytestr(c) |
277 _(b"%r cannot be used in a name") % pycompat.bytestr(c) |
278 ) |
278 ) |
279 try: |
279 try: |
280 int(lbl) |
280 int(lbl) |
|
281 if b'_' in lbl: |
|
282 # If label contains underscores, Python might consider it an |
|
283 # integer (with "_" as visual separators), but we do not. |
|
284 # See PEP 515 - Underscores in Numeric Literals. |
|
285 raise ValueError |
281 raise error.InputError(_(b"cannot use an integer as a name")) |
286 raise error.InputError(_(b"cannot use an integer as a name")) |
282 except ValueError: |
287 except ValueError: |
283 pass |
288 pass |
284 if lbl.strip() != lbl: |
289 if lbl.strip() != lbl: |
285 raise error.InputError( |
290 raise error.InputError( |