Message378321
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. |
|
Date |
User |
Action |
Args |
2020-10-09 13:43:54 | iljah | set | recipients:
+ iljah |
2020-10-09 13:43:54 | iljah | set | messageid: <1602251034.78.0.495592912184.issue41982@roundup.psfhosted.org> |
2020-10-09 13:43:54 | iljah | link | issue41982 messages |
2020-10-09 13:43:54 | iljah | create | |
|