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 9b9c0c6

Browse filesBrowse files
committed
BUG : don't use mutable objects as dictionary keys
Base key on the id of the transform. This maintains the old behavior and does not break the python hashable object model. changed the variable id -> pid so as to not shadow the method `id` Closes #2828
1 parent c73d9e6 commit 9b9c0c6
Copy full SHA for 9b9c0c6

File tree

Expand file treeCollapse file tree

2 files changed

+8
-5
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+8
-5
lines changed

‎CHANGELOG

Copy file name to clipboardExpand all lines: CHANGELOG
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
2014-06-07 Fixed bug so radial plots can be saved as ps in py3k.
2+
13
2014-06-01 Changed the fmt kwarg of errorbar to support the
24
the mpl convention that "none" means "don't draw it",
35
and to default to the empty string, so that plotting

‎lib/matplotlib/backends/backend_ps.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backends/backend_ps.py
+6-5Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -554,15 +554,16 @@ def _convert_path(self, path, transform, clip=False, simplify=None):
554554
return ps
555555

556556
def _get_clip_path(self, clippath, clippath_transform):
557-
id = self._clip_paths.get((clippath, clippath_transform))
558-
if id is None:
559-
id = 'c%x' % len(self._clip_paths)
560-
ps_cmd = ['/%s {' % id]
557+
key = (clippath, id(clippath_transform))
558+
pid = self._clip_paths.get(key)
559+
if pid is None:
560+
pid = 'c%x' % len(self._clip_paths)
561+
ps_cmd = ['/%s {' % pid]
561562
ps_cmd.append(self._convert_path(clippath, clippath_transform,
562563
simplify=False))
563564
ps_cmd.extend(['clip', 'newpath', '} bind def\n'])
564565
self._pswriter.write('\n'.join(ps_cmd))
565-
self._clip_paths[(clippath, clippath_transform)] = id
566+
self._clip_paths[key] = pid
566567
return id
567568

568569
def draw_path(self, gc, path, transform, rgbFace=None):

0 commit comments

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