eric6/Utilities/PySideImporter.py

Sat, 27 Jun 2020 12:08:12 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 27 Jun 2020 12:08:12 +0200
changeset 7639
422fd05e9c91
parent 7635
0cdead130a81
child 7908
33afc8e96e19
child 7924
8a96736d465e
permissions
-rw-r--r--

Removed some more Python2 related code.

# -*- coding: utf-8 -*-

# Copyright (c) 2011 - 2020 Detlev Offenbach <detlev@die-offenbachs.de>
#

"""
Module to check for the presence of PySide2 by importing it.
"""

import sys

if __name__ == "__main__":
    pySideVariant = "2"
    if len(sys.argv) == 2:
        pySideVariant = sys.argv[1].replace("-", "")
    
    if pySideVariant == "1":
        # no PySide support anymore
        ret = 1
    
    elif pySideVariant == "2":
        try:
            import PySide2       # __IGNORE_EXCEPTION__ __IGNORE_WARNING__
            ret = 0
        except ImportError:
            ret = 1
    
    else:
        ret = 1
    
    sys.exit(ret)

eric ide

mercurial