mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-06-19 07:48:11 +00:00
Cleanups for suppression of UserWarnings. refs #1435
This commit is contained in:
@ -144,8 +144,8 @@ def normalized_version(verstr, what=None):
|
|||||||
|
|
||||||
def get_package_versions_and_locations():
|
def get_package_versions_and_locations():
|
||||||
import warnings
|
import warnings
|
||||||
from _auto_deps import package_imports, deprecation_messages, \
|
from _auto_deps import package_imports, deprecation_messages, \
|
||||||
deprecation_imports, user_warning_messages
|
user_warning_messages, warning_imports
|
||||||
|
|
||||||
def package_dir(srcfile):
|
def package_dir(srcfile):
|
||||||
return os.path.dirname(os.path.dirname(os.path.normcase(os.path.realpath(srcfile))))
|
return os.path.dirname(os.path.dirname(os.path.normcase(os.path.realpath(srcfile))))
|
||||||
@ -171,16 +171,16 @@ def get_package_versions_and_locations():
|
|||||||
for msg in user_warning_messages:
|
for msg in user_warning_messages:
|
||||||
warnings.filterwarnings("ignore", category=UserWarning, message=msg, append=True)
|
warnings.filterwarnings("ignore", category=UserWarning, message=msg, append=True)
|
||||||
try:
|
try:
|
||||||
for modulename in deprecation_imports:
|
for modulename in warning_imports:
|
||||||
try:
|
try:
|
||||||
__import__(modulename)
|
__import__(modulename)
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
finally:
|
finally:
|
||||||
for ign in deprecation_messages:
|
|
||||||
warnings.filters.pop()
|
|
||||||
for ign in user_warning_messages:
|
for ign in user_warning_messages:
|
||||||
warnings.filters.pop()
|
warnings.filters.pop()
|
||||||
|
for ign in deprecation_messages:
|
||||||
|
warnings.filters.pop()
|
||||||
|
|
||||||
packages = []
|
packages = []
|
||||||
|
|
||||||
|
@ -117,13 +117,13 @@ deprecation_messages = [
|
|||||||
"the sets module is deprecated",
|
"the sets module is deprecated",
|
||||||
]
|
]
|
||||||
|
|
||||||
deprecation_imports = [
|
user_warning_messages = [
|
||||||
|
"Hashing uninitialized InterfaceClass instance",
|
||||||
|
]
|
||||||
|
|
||||||
|
warning_imports = [
|
||||||
'nevow',
|
'nevow',
|
||||||
'twisted.persisted.sob',
|
'twisted.persisted.sob',
|
||||||
'twisted.python.filepath',
|
'twisted.python.filepath',
|
||||||
'Crypto.Hash.SHA',
|
'Crypto.Hash.SHA',
|
||||||
]
|
]
|
||||||
|
|
||||||
user_warning_messages = [
|
|
||||||
"Hashing uninitialized InterfaceClass instance",
|
|
||||||
]
|
|
||||||
|
Reference in New Issue
Block a user