GitLab will be upgraded on June 2nd 2020 at 2.00 pm (AEDT) to 3.00 pm (AEDT) due to Critical Security Patch Availability. During the update, GitLab and Mattermost services will not be available. If you have any concerns with this, please talk to local Gitlab admin team.

_libmuprivpython3.py 481 Bytes
Newer Older
1 2 3 4 5
from _libmuprivcommon import _assert_instance

def _is_str_like(v):
    return isinstance(v, str) or isinstance(v, bytes)

6
def _encode(v, encoding):
7 8
    _assert_instance(v, bytes, str)
    if isinstance(v, str):
9
        return v.encode(encoding)
10 11 12
    else:
        return v

13
def _decode(v, encoding):
14 15
    _assert_instance(v, bytes, str)
    if isinstance(v, bytes):
16
        return v.decode(encoding)
17 18 19 20 21
    else:
        return v

def _assert_int_like(v):
    _assert_instance(v, int)