diff options
author | Barney Gale <barney.gale@gmail.com> | 2024-04-01 19:37:41 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-01 19:37:41 (GMT) |
commit | fc8007ee3635db6ab73e132ebff987c910b6d538 (patch) | |
tree | d05976e835762f6dba3c81b60cf0f5a9c445aae0 /Lib/glob.py | |
parent | c741ad3537193c63fe697a8f0316aecd45eeb9ba (diff) | |
download | cpython-fc8007ee3635db6ab73e132ebff987c910b6d538.zip cpython-fc8007ee3635db6ab73e132ebff987c910b6d538.tar.gz cpython-fc8007ee3635db6ab73e132ebff987c910b6d538.tar.bz2 |
GH-117337: Deprecate `glob.glob0()` and `glob.glob1()`. (#117371)
These undocumented functions are no longer used by `msilib`, so there's no
reason to keep them around.
Diffstat (limited to 'Lib/glob.py')
-rw-r--r-- | Lib/glob.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Lib/glob.py b/Lib/glob.py index d596411..a915cf0 100644 --- a/Lib/glob.py +++ b/Lib/glob.py @@ -119,12 +119,19 @@ def _glob0(dirname, basename, dir_fd, dironly, include_hidden=False): return [basename] return [] -# Following functions are not public but can be used by third-party code. +_deprecated_function_message = ( + "{name} is deprecated and will be removed in Python {remove}. Use " + "glob.glob and pass a directory to its root_dir argument instead." +) def glob0(dirname, pattern): + import warnings + warnings._deprecated("glob.glob0", _deprecated_function_message, remove=(3, 15)) return _glob0(dirname, pattern, None, False) def glob1(dirname, pattern): + import warnings + warnings._deprecated("glob.glob1", _deprecated_function_message, remove=(3, 15)) return _glob1(dirname, pattern, None, False) # This helper function recursively yields relative pathnames inside a literal |