File: util.py

package info (click to toggle)
dbus-fast 3.1.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,804 kB
  • sloc: python: 9,997; xml: 39; makefile: 29; sh: 5
file content (16 lines) | stat: -rw-r--r-- 355 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
_has_gi = None
skip_reason_no_gi = "glib tests require python3-gi"


def check_gi_repository():
    global _has_gi
    if _has_gi is not None:
        return _has_gi
    try:
        from gi.repository import GLib  # noqa: F401, PLC0415

        _has_gi = True
        return _has_gi
    except ImportError:
        _has_gi = False
        return _has_gi