A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2015-May/140186.html below:

[Python-Dev] [Python-checkins] cpython (3.4): Issue #23840: tokenize.open() now closes the temporary binary file on error to

[Python-Dev] [Python-checkins] cpython (3.4): Issue #23840: tokenize.open() now closes the temporary binary file on error to [Python-Dev] [Python-checkins] cpython (3.4): Issue #23840: tokenize.open() now closes the temporary binary file on error toYury Selivanov yselivanov.ml at gmail.com
Tue May 26 07:33:46 CEST 2015
On 2015-05-26 12:26 AM, Terry Reedy wrote:
>> +    try:
>> +        encoding, lines = detect_encoding(buffer.readline)
>> +        buffer.seek(0)
>> +        text = TextIOWrapper(buffer, encoding, line_buffering=True)
>> +        text.mode = 'r'
>> +        return text
>> +    except:
>> +        buffer.close()
>> +        raise
>
> Please do not add bare 'except:'.  If you mean 'except 
> BaseException:', say so. 

try..finally would be even better.

Yury
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4