File: update-sip-import.patch

package info (click to toggle)
pyside2 5.15.8-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 34,708 kB
  • sloc: python: 223,764; cpp: 80,118; xml: 17,240; sh: 68; makefile: 39; javascript: 16
file content (25 lines) | stat: -rw-r--r-- 884 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Description: Update import of PyQt5 private sip module and remove Python 2/PyQt4 setapi calls
Author: Kurt Kremitzki <kkremitzki@debian.org>
Last-Updated: 2020-12-20

--- a/sources/pyside2/tests/tools/list-class-hierarchy.py
+++ b/sources/pyside2/tests/tools/list-class-hierarchy.py
@@ -96,14 +96,10 @@
     for l in libraries:
         dictionary = []
         if l =="PyQt5":
-            import sip
-            sip.setapi('QDate',2)
-            sip.setapi('QDateTime',2)
-            sip.setapi('QString',2)
-            sip.setapi('QTextStream',2)
-            sip.setapi('QTime',2)
-            sip.setapi('QUrl',2)
-            sip.setapi('QVariant',2)
+            try:
+                from PyQt5 import sip
+            except ModuleNotFoundError:
+                import sip
 
         for m in modules:
             exec("from %s import %s" % (l,m), globals(), locals())