File: util.py

package info (click to toggle)
python-dbus-next 0.2.3-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 696 kB
  • sloc: python: 6,018; makefile: 45; xml: 29
file content (15 lines) | stat: -rw-r--r-- 331 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
_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
        _has_gi = True
        return _has_gi
    except ImportError:
        _has_gi = False
        return _has_gi