mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Reduce deprecation warnings (refs: #3192)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user