[pydot/f14] apply fix for pebl relating to catching AttributeError, thanks to Thomas Spura

Tom Callaway spot at fedoraproject.org
Tue Oct 11 15:00:06 UTC 2011


commit 3a3ced1c250ce37ebf6b97cedb2ebe841813909b
Author: Tom "spot" Callaway <tcallawa at redhat.com>
Date:   Tue Oct 11 10:59:49 2011 -0400

    apply fix for pebl relating to catching AttributeError, thanks to Thomas Spura

 pydot-fix-with-pebl.patch |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/pydot-fix-with-pebl.patch b/pydot-fix-with-pebl.patch
new file mode 100644
index 0000000..1cfca69
--- /dev/null
+++ b/pydot-fix-with-pebl.patch
@@ -0,0 +1,26 @@
+--- pydot-1.0.25/pydot.py	2011-10-09 18:07:19.345585402 +0200
++++ pydot-1.0.25/pydot.py	2011-10-09 18:08:05.764531832 +0200
+@@ -591,7 +591,10 @@
+             if default_node_name in ('subgraph', 'digraph', 'cluster'):
+                 default_node_name = 'graph'
+                 
+-            defaults = self.get_parent_graph().get_node( default_node_name )
++            try:
++            	defaults = self.get_parent_graph().get_node( default_node_name )
++            except AttributeError:
++                defaults = None
+             
+             # Multiple defaults could be set by having repeated 'graph [...]'
+             # 'node [...]', 'edge [...]' statements. In such case, if the
+@@ -605,7 +608,10 @@
+                 defaults = [defaults]
+                 
+             for default in defaults:
+-                attr_val = default.obj_dict['attributes'].get(attr, None)
++                try:
++                    attr_val = default.obj_dict['attributes'].get(attr, None)
++                except AttributeError:
++                    attr_val = None
+                 if attr_val:
+                     return attr_val
+         else:


More information about the scm-commits mailing list