Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Avoid triggering a DeprecationWarning.
  • Loading branch information
anntzer committed May 6, 2018
commit 7a727a1eda7076daa01dcdcbed77ed0c519d986b
2 changes: 2 additions & 0 deletions lib/matplotlib/backends/backend_cairo.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,8 @@ def _draw_paths():
# We actually need to call the setters to reset the internal state.
vars(gc).update(gc_vars)
for k, v in gc_vars.items():
if k == "_linestyle": # Deprecated, no effect.
continue
try:
getattr(gc, "set" + k)(v)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No underscore is needed?

Copy link
Contributor Author

@anntzer anntzer Feb 3, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually no, I'm just copying the __dict__ of the original gc, and (kind of an implementation detail...) GraphicsContextBase stores "property" foo (accessed by get/set_foo) in ._foo). Not very elegant I admit.

except (AttributeError, TypeError) as e:
Expand Down