11 |
11 |
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 import sip |
16 try: |
|
17 import sip |
|
18 except ImportError: |
|
19 from PyQt5 import sip |
17 sip.setapi('QString', 2) |
20 sip.setapi('QString', 2) |
18 sip.setapi('QVariant', 2) |
21 sip.setapi('QVariant', 2) |
19 sip.setapi('QTextStream', 2) |
22 sip.setapi('QTextStream', 2) |
20 input = raw_input # __IGNORE_WARNING__ |
23 input = raw_input # __IGNORE_WARNING__ |
21 except (ImportError): |
24 except (ImportError): |
1423 print('5.3.0 or better.') |
1426 print('5.3.0 or better.') |
1424 exit(2) |
1427 exit(2) |
1425 |
1428 |
1426 # check version of sip |
1429 # check version of sip |
1427 try: |
1430 try: |
1428 import sip |
1431 try: |
|
1432 import sip |
|
1433 except ImportError: |
|
1434 from PyQt5 import sip |
1429 sipVersion = sip.SIP_VERSION_STR |
1435 sipVersion = sip.SIP_VERSION_STR |
1430 print("sip Version:", sipVersion.strip()) |
1436 print("sip Version:", sipVersion.strip()) |
1431 # always assume, that snapshots or dev versions are new enough |
1437 # always assume, that snapshots or dev versions are new enough |
1432 if "snapshot" not in sipVersion and "dev" not in sipVersion: |
1438 if "snapshot" not in sipVersion and "dev" not in sipVersion: |
1433 while sipVersion.count('.') < 2: |
1439 while sipVersion.count('.') < 2: |