%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/setuptools/_distutils/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/setuptools/_distutils/_functools.py

import functools


# from jaraco.functools 3.5
def pass_none(func):
    """
    Wrap func so it's not called if its first param is None

    >>> print_text = pass_none(print)
    >>> print_text('text')
    text
    >>> print_text(None)
    """

    @functools.wraps(func)
    def wrapper(param, *args, **kwargs):
        if param is not None:
            return func(param, *args, **kwargs)

    return wrapper

Zerion Mini Shell 1.0