diff tests/hghave.py @ 22198:77142de48ae4

cleanup: make sure we always access members of imported modules This will make sure we get import errors, even if demandimport is enabled. This will also mute some pyflakes 'imported but unused' warnings.
author Mads Kiilerich <madski@unity3d.com>
date Fri, 15 Aug 2014 04:37:45 +0200
parents 45611a306f77
children d7f7f1860f00
line wrap: on
line diff
--- a/tests/hghave.py	Fri Aug 15 20:28:51 2014 +0900
+++ b/tests/hghave.py	Fri Aug 15 04:37:45 2014 +0200
@@ -148,6 +148,7 @@
 def has_lsprof():
     try:
         import _lsprof
+        _lsprof.Profiler # silence unused import warning
         return True
     except ImportError:
         return False
@@ -164,6 +165,7 @@
 def has_docutils():
     try:
         from docutils.core import publish_cmdline
+        publish_cmdline # silence unused import
         return True
     except ImportError:
         return False
@@ -270,6 +272,7 @@
 def has_pygments():
     try:
         import pygments
+        pygments.highlight # silence unused import warning
         return True
     except ImportError:
         return False
@@ -288,6 +291,7 @@
 def has_ssl():
     try:
         import ssl
+        ssl.wrap_socket # silence unused import warning
         import OpenSSL
         OpenSSL.SSL.Context
         return True