]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/blobdiff - src/allmydata/__init__.py
src/allmydata/__init__.py: head off a possible warning on platforms where twisted...
[tahoe-lafs/tahoe-lafs.git] / src / allmydata / __init__.py
index 083567b3ec061234586b2aada6e13498d4b57284..7c5236335a3f278154448ada07c2d45b995c45c0 100644 (file)
@@ -144,7 +144,7 @@ def normalized_version(verstr, what=None):
 
 def get_package_versions_and_locations():
     import warnings
-    from _auto_deps import package_imports, deprecation_messages, \
+    from _auto_deps import package_imports, global_deprecation_messages, deprecation_messages, \
         user_warning_messages, runtime_warning_messages, warning_imports
 
     def package_dir(srcfile):
@@ -155,16 +155,10 @@ def get_package_versions_and_locations():
     # or any other bug that causes sys.path to be set up incorrectly. Therefore we
     # must import the packages in order to check their versions and paths.
 
-    # This warning is generated by twisted, PyRex, and possibly other packages,
-    # but can happen at any time, not only when they are imported. See ticket #1129.
-    warnings.filterwarnings("ignore", category=DeprecationWarning,
-        message="BaseException.message has been deprecated as of Python 2.6",
-        append=True)
-
     # This is to suppress various DeprecationWarnings, UserWarnings, and RuntimeWarnings
-    # (listed in _auto_deps.py) that occur when modules are imported.
+    # (listed in _auto_deps.py).
 
-    for msg in deprecation_messages:
+    for msg in global_deprecation_messages + deprecation_messages:
         warnings.filterwarnings("ignore", category=DeprecationWarning, message=msg, append=True)
     for msg in user_warning_messages:
         warnings.filterwarnings("ignore", category=UserWarning, message=msg, append=True)
@@ -177,6 +171,7 @@ def get_package_versions_and_locations():
             except ImportError:
                 pass
     finally:
+        # Leave suppressions for global_deprecation_messages active.
         for ign in runtime_warning_messages + user_warning_messages + deprecation_messages:
             warnings.filters.pop()
 
@@ -276,7 +271,7 @@ def cross_check(pkg_resources_vers_and_locs, imported_vers_and_locs_list):
     errors = []
     not_pkg_resourceable = set(['python', 'platform', __appname__.lower()])
     not_import_versionable = set(['zope.interface', 'mock', 'pyasn1'])
-    ignorable = set(['argparse', 'pyutil', 'zbase32', 'distribute', 'twisted-web', 'twisted-core'])
+    ignorable = set(['argparse', 'pyutil', 'zbase32', 'distribute', 'twisted-web', 'twisted-core', 'twisted-conch'])
 
     for name, (imp_ver, imp_loc, imp_comment) in imported_vers_and_locs_list:
         name = name.lower()
@@ -395,7 +390,7 @@ def get_package_versions_string(show_paths=False, debug=False):
             info = info + " (%s)" % str(loc)
         res.append(info)
 
-    output = ",\n".join(res) + "\n"
+    output = "\n".join(res) + "\n"
 
     if not hasattr(sys, 'frozen'):
         errors = cross_check_pkg_resources_versus_import()