From be59ac638e26aff5204a32333f7ebe046003065a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Date: Tue, 9 Jun 2020 08:46:46 +0200
Subject: [PATCH] Make PyQt checks in tests more specific

Test whether the widgets module can be imported rather than 'PyQt?'
in general.  The latter gives false positives if PyQt is uninstalled
but there are leftover subpackages such as qscintilla.  In this case,
Python 3 imports 'PyQt?' as a namespace.
---
 tests/test_pyperclip.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/test_pyperclip.py b/tests/test_pyperclip.py
index 7519d94..2942639 100644
--- a/tests/test_pyperclip.py
+++ b/tests/test_pyperclip.py
@@ -146,10 +146,10 @@ class TestGtk(_TestClipboard):
 class TestQt(_TestClipboard):
     if HAS_DISPLAY:
         try:
-            import PyQt5
+            import PyQt5.QtWidgets
         except ImportError:
             try:
-                import PyQt4
+                import PyQt4.QtGui
             except ImportError:
                 pass
             else:
-- 
2.27.0

