8000 Deprecate rcsetup.validate_path_exists. (#14347) · matplotlib/matplotlib@03fc2ef · GitHub
[go: up one dir, main page]

Skip to content

Commit 03fc2ef

Browse files
anntzertimhoffm
authored andcommitted
Deprecate rcsetup.validate_path_exists. (#14347)
* Deprecate rcsetup.validate_path_exists. It's only used to validate setting the path to the matplotlib data, but of course the path just existing hardly indicates that that's the correct path to the matplotlib data; moreover, the intent (see `_get_data_path`) is that it should not be user-settable to start with. * correct deprecation version
1 parent 29265dc commit 03fc2ef

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

doc/api/next_api_changes/2019-05-27-AL.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Deprecations
2+
````````````
3+
4+
``rcsetup.validate_path_exists`` is deprecated (use ``os.path.exists`` to check
5+
whether a path exists).

lib/matplotlib/rcsetup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ def validate_any(s):
109109
validate_anylist = _listify_validator(validate_any)
110110

111111

112+
@cbook.deprecated("3.2", alternative="os.path.exists")
112113
def validate_path_exists(s):
113114
"""If s is a path, return s, else False"""
114115
if s is None:
@@ -957,8 +958,7 @@ def _validate_linestyle(ls):
957958
'webagg.open_in_browser': [True, validate_bool],
958959
'webagg.port_retries': [50, validate_int],
959960
'toolbar': ['toolbar2', validate_toolbar],
960-
'datapath': [None, validate_path_exists], # handled by
961-
# _get_data_path_cached
961+
'datapath': [None, validate_any], # see _get_data_path_cached
962962
'interactive': [False, validate_bool],
963963
'timezone': ['UTC', validate_string],
964964

0 commit comments

Comments
 (0)
0