Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6962aac

Browse filesBrowse files
committed
Merge pull request #4278 from mfitzp/pyqt4-api1-py3-compat
MNT : Replace use of str() with six.text_type() for Py2&3 compatibility
2 parents 174fc94 + 378e37d commit 6962aac
Copy full SHA for 6962aac

File tree

Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed

‎lib/matplotlib/backends/backend_qt5.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_qt5.py
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def _create_qApp():
137137
if display is None or not re.search(':\d', display):
138138
raise RuntimeError('Invalid DISPLAY variable')
139139

140-
qApp = QtWidgets.QApplication([str(" ")])
140+
qApp = QtWidgets.QApplication([six.text_type(" ")])
141141
qApp.lastWindowClosed.connect(qApp.quit)
142142
else:
143143
qApp = app
@@ -560,7 +560,7 @@ def destroy(self, *args):
560560
self.window.close()
561561

562562
def get_window_title(self):
563-
return str(self.window.windowTitle())
563+
return six.text_type(self.window.windowTitle())
564564

565565
def set_window_title(self, title):
566566
self.window.setWindowTitle(title)
@@ -733,7 +733,7 @@ def save_figure(self, *args):
733733
self.canvas.print_figure(six.text_type(fname))
734734
except Exception as e:
735735
QtWidgets.QMessageBox.critical(
736-
self, "Error saving file", str(e),
736+
self, "Error saving file", six.text_type(e),
737737
QtWidgets.QMessageBox.Ok, QtWidgets.QMessageBox.NoButton)
738738

739739

@@ -849,7 +849,7 @@ def exception_handler(type, value, tb):
849849
if hasattr(value, 'strerror') and value.strerror is not None:
850850
msg += value.strerror
851851
else:
852-
msg += str(value)
852+
msg += six.text_type(value)
853853

854854
if len(msg):
855855
error_msg_qt(msg)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.