File size: 404 Bytes
fb5159d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import types
import io as _io


def text_encoding(encoding, stacklevel=2):
    """
    Stubbed version of io.text_encoding as found in Python 3.10
    """
    return encoding


def copy_module(mod, **defaults):
    copy = types.ModuleType(mod.__name__, doc=mod.__doc__)
    vars(copy).update(defaults)
    vars(copy).update(vars(mod))
    return copy


io = copy_module(_io, text_encoding=text_encoding)