Reduce deprecation warnings (refs: #3192)

This commit is contained in:
Takeshi KOMIYA
2016-12-15 13:12:13 +09:00
parent 108491d49e
commit 9fc53cecf7
7 changed files with 34 additions and 20 deletions

View File

@@ -11,7 +11,9 @@ import os
import re
import sys
import tempfile
import warnings
from functools import wraps
from xml.etree import ElementTree
from six import StringIO, string_types
@@ -155,6 +157,12 @@ def skip_unless_importable(module, msg=None):
return skip_if(False, msg)
def etree_parse(path):
with warnings.catch_warnings(record=False):
warnings.filterwarnings("ignore", category=DeprecationWarning)
return ElementTree.parse(path)
class Struct(object):
def __init__(self, **kwds):
self.__dict__.update(kwds)