From 9468226a9e2e2ab8cdd599f1d8538e860ca86120 Mon Sep 17 00:00:00 2001 From: Biswakalyan Bhuyan Date: Sun, 13 Nov 2022 23:46:45 +0530 Subject: id card generator --- .../setuptools/_distutils/_functools.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 env/lib/python3.10/site-packages/setuptools/_distutils/_functools.py (limited to 'env/lib/python3.10/site-packages/setuptools/_distutils/_functools.py') diff --git a/env/lib/python3.10/site-packages/setuptools/_distutils/_functools.py b/env/lib/python3.10/site-packages/setuptools/_distutils/_functools.py new file mode 100644 index 0000000..e7053ba --- /dev/null +++ b/env/lib/python3.10/site-packages/setuptools/_distutils/_functools.py @@ -0,0 +1,20 @@ +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 -- cgit v1.2.3-59-g8ed1b