diff --git a/python/ert/__init__.py b/python/ert/__init__.py index 64b22a3a08..94e27d6a30 100644 --- a/python/ert/__init__.py +++ b/python/ert/__init__.py @@ -1,8 +1,14 @@ import warnings -warnings.simplefilter('always', DeprecationWarning) # see #1437 +warnings.filterwarnings( + action='always', + category=DeprecationWarning, + module=r'ecl|ert|res' +) + warnings.warn( - "Importing from ert is deprecated and will be removed in a future release, use: \'from res import\' instead", + "Importing from ert.ecl, ecl.ecl or ert is deprecated and will not be available in python3." \ + " For eclipse functionality use \'from ecl import\', for ert workflow tooling use \'from res import\'.", DeprecationWarning ) diff --git a/python/res/__init__.py b/python/res/__init__.py index c90ac61f2f..519aad508e 100644 --- a/python/res/__init__.py +++ b/python/res/__init__.py @@ -32,7 +32,11 @@ import sys import warnings -warnings.simplefilter('always', DeprecationWarning) # see #1437 +warnings.filterwarnings( + action='always', + category=DeprecationWarning, + module=r'res|ert' +) from cwrap import load as cwrapload from cwrap import Prototype