Bug report
Bug description:
Some syntax errors (I was able to find at least 2 cases) lead to incorrect messages that completely make it impossible to understand what exactly is wrong. In this case, the error is always thrown on the first import with an alias via as.
The first case is written twice ;:
import torch;
import torch.nn as nn;
def foo(x: torch.Tensor, y: torch.Tensor) -> torch.Tensor:
d = torch.sqrt(x ** 2 + y ** 2);;
return d;
The second case is the re-specified def when declaring the function.:
import torch;
import torch.nn as nn;
def foo(x: torch.Tensor, y: torch.Tensor) -> torch.Tensor:
d = torch.sqrt(x ** 2 + y ** 2);
return d;
def def bar():
pass;
Deleting ; after importing with as returns the correct error message.
CPython versions tested on:
3.14
Operating systems tested on:
Windows
Bug report
Bug description:
Some syntax errors (I was able to find at least 2 cases) lead to incorrect messages that completely make it impossible to understand what exactly is wrong. In this case, the error is always thrown on the first import with an alias via
as.The first case is written twice
;:The second case is the re-specified
defwhen declaring the function.:Deleting
;after importing withasreturns the correct error message.CPython versions tested on:
3.14
Operating systems tested on:
Windows