From a683e40c41a9720c049856babce7b2da7cebf56b Mon Sep 17 00:00:00 2001 From: Junzi Sun Date: Wed, 11 Sep 2019 16:01:55 +0200 Subject: [PATCH] deprecation warning only one time --- pyModeS/__init__.py | 8 ++++---- pyModeS/decoder/bds/bds40.py | 2 -- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/pyModeS/__init__.py b/pyModeS/__init__.py index 1869275..bc491d9 100644 --- a/pyModeS/__init__.py +++ b/pyModeS/__init__.py @@ -1,5 +1,8 @@ from __future__ import absolute_import, print_function, division +import os +import warnings + from .decoder.common import * from .decoder import tell from .decoder import adsb @@ -9,9 +12,6 @@ from .decoder import bds from .extra import aero from .extra import tcpclient -# from .decoder import els # depricated -# from .decoder import ehs # depricated - -import os +warnings.simplefilter("once", DeprecationWarning) dirpath = os.path.dirname(os.path.realpath(__file__)) diff --git a/pyModeS/decoder/bds/bds40.py b/pyModeS/decoder/bds/bds40.py index cf96cbe..181149f 100644 --- a/pyModeS/decoder/bds/bds40.py +++ b/pyModeS/decoder/bds/bds40.py @@ -121,7 +121,6 @@ def p40baro(msg): def alt40mcp(msg): - warnings.simplefilter("once", DeprecationWarning) warnings.warn( "alt40mcp() has been renamed to selalt40mcp(). It will be removed in the future.", DeprecationWarning, @@ -130,7 +129,6 @@ def alt40mcp(msg): def alt40fms(msg): - warnings.simplefilter("once", DeprecationWarning) warnings.warn( "alt40fms() has been renamed to selalt40fms(). It will be removed in the future.", DeprecationWarning,