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

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


commit 058a46590c9182c1ec64475d8017108a870914cb
Author: Tom "spot" Callaway <tcallawa at redhat.com>
Date:   Tue Oct 11 11:06:29 2011 -0400

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

 pydot-fix-with-pebl.patch |   26 ++++++++++++++++++++++++++
 pydot.spec                |   16 ++++++++--------
 2 files changed, 34 insertions(+), 8 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:
diff --git a/pydot.spec b/pydot.spec
index a856e81..5d5f305 100644
--- a/pydot.spec
+++ b/pydot.spec
@@ -2,13 +2,14 @@
 
 Name:		pydot
 Version:	1.0.25
-Release:	1%{?dist}
+Release:	2%{?dist}
 License:	MIT
 Group:		System Environment/Libraries
 Summary:	Python interface to Graphviz's Dot language
 URL:		http://code.google.com/p/pydot/
 Source0:	http://pydot.googlecode.com/files/pydot-%{version}.tar.gz
-BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+# http://code.google.com/p/pydot/issues/detail?id=60
+Patch0:		pydot-fix-with-pebl.patch
 BuildRequires:	pyparsing python-devel
 Requires:	graphviz, pyparsing
 BuildArch:	noarch
@@ -24,28 +25,27 @@ tools dot, neato, twopi.
 
 %prep
 %setup -q
+%patch0 -p1 -b .peblfix
 
 %build
 %{__python} setup.py build
 
 %install
-rm -rf $RPM_BUILD_ROOT
 %{__python} setup.py install --skip-build --root=$RPM_BUILD_ROOT
 
 # Why would you do this? :/
 rm -rf $RPM_BUILD_ROOT%{_prefix}/LICENSE $RPM_BUILD_ROOT%{_prefix}/README
 
-%clean
-rm -rf $RPM_BUILD_ROOT
-
 %files
-%defattr(-,root,root,-)
 %doc LICENSE PKG-INFO README
 %{python_sitelib}/dot_parser.py*
-%{python_sitelib}/pydot-*.egg-info/
 %{python_sitelib}/pydot.*
+%{python_sitelib}/pydot-%{version}*.egg-info
 
 %changelog
+* Tue Oct 11 2011 Tom Callaway <spot at fedoraproject.org> - 1.0.25-2
+- apply fix for pebl relating to catching AttributeError, thanks to Thomas Spura
+
 * Thu Apr 21 2011 Tom Callaway <spot at fedoraproject.org> - 1.0.25-1
 - update to 1.0.25
 


More information about the scm-commits mailing list