12 from __future__ import unicode_literals, print_function |
12 from __future__ import unicode_literals, print_function |
13 try: |
13 try: |
14 # Python2 only |
14 # Python2 only |
15 import cStringIO as io |
15 import cStringIO as io |
16 try: |
16 try: |
|
17 from PyQt5 import sip |
|
18 except ImportError: |
17 import sip |
19 import sip |
18 except ImportError: |
|
19 from PyQt5 import sip |
|
20 sip.setapi('QString', 2) |
20 sip.setapi('QString', 2) |
21 sip.setapi('QVariant', 2) |
21 sip.setapi('QVariant', 2) |
22 sip.setapi('QTextStream', 2) |
22 sip.setapi('QTextStream', 2) |
23 input = raw_input # __IGNORE_WARNING__ |
23 input = raw_input # __IGNORE_WARNING__ |
24 except (ImportError): |
24 except (ImportError): |
1427 exit(2) |
1427 exit(2) |
1428 |
1428 |
1429 # check version of sip |
1429 # check version of sip |
1430 try: |
1430 try: |
1431 try: |
1431 try: |
|
1432 from PyQt5 import sip |
|
1433 except ImportError: |
1432 import sip |
1434 import sip |
1433 except ImportError: |
|
1434 from PyQt5 import sip |
|
1435 sipVersion = sip.SIP_VERSION_STR |
1435 sipVersion = sip.SIP_VERSION_STR |
1436 print("sip Version:", sipVersion.strip()) |
1436 print("sip Version:", sipVersion.strip()) |
1437 # always assume, that snapshots or dev versions are new enough |
1437 # always assume, that snapshots or dev versions are new enough |
1438 if "snapshot" not in sipVersion and "dev" not in sipVersion: |
1438 if "snapshot" not in sipVersion and "dev" not in sipVersion: |
1439 while sipVersion.count('.') < 2: |
1439 while sipVersion.count('.') < 2: |