[sstruct/xmlWriter]: issue a deprecation warning when the two top-level modules are imported

Part of #696

(These are a actually `UserWarning` instead of `DeprecationWarning`, as the latter are normally muted)
This commit is contained in:
Cosimo Lupo 2016-10-08 17:21:36 +01:00
parent 8a7b245069
commit c719da5bca
2 changed files with 14 additions and 0 deletions

View File

@ -5,3 +5,10 @@ from fontTools.misc.py23 import *
from fontTools.misc.sstruct import *
from fontTools.misc.sstruct import __doc__
import warnings
warnings.warn(
"Importing the stand-alone `sstruct` module is deprecated. "
"Use `from fontTools.misc import sstruct` instead.",
stacklevel=2)

View File

@ -5,3 +5,10 @@ from fontTools.misc.py23 import *
from fontTools.misc.xmlWriter import *
from fontTools.misc.xmlWriter import __doc__
import warnings
warnings.warn(
"Importing the stand-alone `xmlWriter` module is deprecated. "
"Use `from fontTools.misc import xmlWriter` instead.",
stacklevel=2)