Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9deae15

Browse files
committed
BUG : restore back-compatibility of regisiter_backend
revert back-incompatible change from 8159c81 closes matplotlib#3439
1 parent fe125ec commit 9deae15

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

lib/matplotlib/backend_bases.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,19 +98,21 @@ def import_module(name):
9898
}
9999

100100

101-
def register_backend(format, backend, description):
101+
def register_backend(format, backend, description=None):
102102
"""
103103
Register a backend for saving to a given file format.
104104
105-
*format*
105+
format : str
106106
File extention
107107
108-
*backend*
109-
Backend for handling file output (module string or canvas class)
108+
backend : module string or canvas class
109+
Backend for handling file output
110110
111-
*description*
112-
Description of the file type
111+
description : str, optional
112+
Description of the file type. Defaults to an empty string
113113
"""
114+
if description is None:
115+
description = ''
114116
_default_backends[format] = backend
115117
_default_filetypes[format] = description
116118

0 commit comments

Comments
 (0)