• Anthony Sottile's avatar
    bpo-2180: Treat line continuation at EOF as a `SyntaxError` (GH-13401) · abea73bf
    Anthony Sottile authored
    
    
    This makes the parser consistent with the tokenize module (already the case
    in `pypy`).
    
    sample
    ------
    
    ```python
    x = 5\
    ```
    
    before
    ------
    
    ```console
    $ python3 t.py
    $ python3 -mtokenize t.py
    t.py:2:0: error: EOF in multi-line statement
    ```
    
    after
    -----
    
    ```console
    $ ./python t.py
      File "t.py", line 3
        x = 5\
    
             ^
    SyntaxError: unexpected EOF while parsing
    $ ./python -m tokenize t.py
    t.py:2:0: error: EOF in multi-line statement
    ```
    
    
    
    https://bugs.python.org/issue2180
    abea73bf
2019-05-17-18-34-30.bpo-2180.aBqHeW.rst 72 Bytes