From e84602b8f2b95d10d45eb11369ae7d627339c881 Mon Sep 17 00:00:00 2001 From: robot-piglet Date: Tue, 12 Mar 2024 17:24:47 +0300 Subject: Intermediate changes --- contrib/python/ipython/py3/IPython/utils/path.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'contrib/python/ipython/py3/IPython/utils/path.py') diff --git a/contrib/python/ipython/py3/IPython/utils/path.py b/contrib/python/ipython/py3/IPython/utils/path.py index ccb70dccd43..cb5be041957 100644 --- a/contrib/python/ipython/py3/IPython/utils/path.py +++ b/contrib/python/ipython/py3/IPython/utils/path.py @@ -12,6 +12,7 @@ import errno import shutil import random import glob +import warnings from IPython.utils.process import system @@ -292,7 +293,14 @@ def target_outdated(target,deps): If target doesn't exist or is older than any file listed in deps, return true, otherwise return false. + + .. deprecated:: 8.22 """ + warnings.warn( + "`target_outdated` is deprecated since IPython 8.22 and will be removed in future versions", + DeprecationWarning, + stacklevel=2, + ) try: target_time = os.path.getmtime(target) except os.error: @@ -312,9 +320,17 @@ def target_update(target,deps,cmd): target_update(target,deps,cmd) -> runs cmd if target is outdated. This is just a wrapper around target_outdated() which calls the given - command if target is outdated.""" + command if target is outdated. + + .. deprecated:: 8.22 + """ - if target_outdated(target,deps): + warnings.warn( + "`target_update` is deprecated since IPython 8.22 and will be removed in future versions", + DeprecationWarning, + stacklevel=2, + ) + if target_outdated(target, deps): system(cmd) -- cgit v1.3