mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-29783: Replace codecs.open() with io.open() (#599)
This commit is contained in:
parent
faa63d1e84
commit
272d888c7b
5 changed files with 18 additions and 39 deletions
|
@ -5,9 +5,10 @@ Written by Marc-Andre Lemburg (mal@lemburg.com).
|
|||
|
||||
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
|
||||
|
||||
"""#"
|
||||
"""
|
||||
|
||||
import builtins, sys
|
||||
import builtins
|
||||
import sys
|
||||
|
||||
### Registry and builtin stateless codec functions
|
||||
|
||||
|
@ -739,7 +740,7 @@ class StreamReaderWriter:
|
|||
"""
|
||||
return getattr(self.stream, name)
|
||||
|
||||
# these are needed to make "with codecs.open(...)" work properly
|
||||
# these are needed to make "with StreamReaderWriter(...)" work properly
|
||||
|
||||
def __enter__(self):
|
||||
return self
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue