8000 FIX: deprecate qt4/5 rcparams · matplotlib/matplotlib@3cce6f8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3cce6f8

Browse files
committed
FIX: deprecate qt4/5 rcparams
1 parent 17112e8 commit 3cce6f8

File tree

1 file changed

+12
-17
lines changed

1 file changed

+12
-17
lines changed

lib/matplotlib/rcsetup.py

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -267,31 +267,26 @@ def validate_backend(s):
267267

268268

269269
def validate_qt4(s):
270-
# Don't spam the test suite with warnings every time the rcparams are
271-
# reset. While it may seem better to use filterwarnings from within the
272-
# test suite, pytest 3.1+ explicitly disregards warnings filters (pytest
273-
# issue #2430).
274270
if s is None:
271+
# return a reasonable default for deprecation period
275272
return 'PyQt4'
276-
if not testing.is_called_from_pytest():
277-
cbook.warn_deprecated(
278-
"2.2",
279-
"The backend.qt4 rcParam was deprecated in version 2.2. In order "
280-
"to force the use of a specific Qt4 binding, either import that "
281-
"binding first, or set the QT_API environment variable.")
273+
cbook.warn_deprecated(
274+
"2.2",
275+
"The backend.qt4 rcParam was deprecated in version 2.2. In order "
276+
"to force the use of a specific Qt4 binding, either import that "
277+
"binding first, or set the QT_API environment variable.")
282278
return ValidateInStrings("backend.qt4", ['PyQt4', 'PySide', 'PyQt4v2'])(s)
283279

284280

285281
def validate_qt5(s):
286-
# See comment re: validate_qt4.
287282
if s is None:
283+
# return a reasonable default for deprecation period
288284
return 'PyQt5'
289-
if not testing.is_called_from_pytest():
290-
cbook.warn_deprecated(
291-
"2.2",
292-
"The backend.qt5 rcParam was deprecated in version 2.2. In order "
293-
"to force the use of a specific Qt5 binding, either import that "
294-
"binding first, or set the QT_API environment variable.")
285+
cbook.warn_deprecated(
286+
"2.2",
287+
"The backend.qt5 rcParam was deprecated in version 2.2. In order "
288+
"to force the use of a specific Qt5 binding, either import that "
289+
"binding first, or set the QT_API environment variable.")
295290
return ValidateInStrings("backend.qt5", ['PyQt5', 'PySide2'])(s)
296291

297292

0 commit comments

Comments
 (0)
0