New submission from iljah :
File:
#! /usr/bin/env python3
with \
open('file1', 'w') as file1,
open('file2', 'w') as file2:
print('ok')
gives error:
File "./test.py", line 3
open('file1', 'w') as file1,
^
SyntaxError: invalid syntax
but adding \ after file1 fixes it:
open('file1', 'w') as file1, \
Location flagged by syntax error (between as and file1) is not correct.
--
components: Interpreter Core
messages: 378321
nosy: iljah
priority: normal
severity: normal
status: open
title: Wrong location flagged as syntax error
type: behavior
versions: Python 3.8
___
Python tracker
<https://bugs.python.org/issue41982>
___
___
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com