File: _util.py

package info (click to toggle)
python-bugzilla 3.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 1,072 kB
  • sloc: python: 5,760; makefile: 9
file content (12 lines) | stat: -rw-r--r-- 334 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
# This work is licensed under the GNU GPLv2 or later.
# See the COPYING file in the top-level directory.


def listify(val):
    """Ensure that value is either None or a list, converting single values
    into 1-element lists"""
    if val is None:
        return val
    if isinstance(val, list):
        return val
    return [val]