[python-collada] Fix error for Python 3.4.

Richard Shaw hobbes1069 at fedoraproject.org
Thu Oct 2 03:01:42 UTC 2014


commit e57f8f95938a9c509a77092abf58c180a01bc999
Author: Richard M. Shaw <hobbes1069 at gmail.com>
Date:   Wed Oct 1 22:01:34 2014 -0500

    Fix error for Python 3.4.

 python-collada-py34.patch |   39 +++++++++++++++++++++++++++++++++++++++
 python-collada.spec       |    8 +++++++-
 2 files changed, 46 insertions(+), 1 deletions(-)
---
diff --git a/python-collada-py34.patch b/python-collada-py34.patch
new file mode 100644
index 0000000..00f9c9c
--- /dev/null
+++ b/python-collada-py34.patch
@@ -0,0 +1,39 @@
+From 30537ecc116bf7e366c4e9d99380059ec2fdb6c7 Mon Sep 17 00:00:00 2001
+From: Jeff Terrace <jterrace at gmail.com>
+Date: Tue, 30 Sep 2014 21:50:42 -0700
+Subject: [PATCH] Change iteritems() to items() in getInputList. Add test.
+ Fixes #40.
+
+---
+ collada/primitive.py          | 2 +-
+ collada/tests/test_collada.py | 4 ++++
+ 2 files changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/collada/primitive.py b/collada/primitive.py
+index d753252..1bdeb7c 100644
+--- a/collada/primitive.py
++++ b/collada/primitive.py
+@@ -173,7 +173,7 @@ def _getInputs(collada, localscope, inputnodes):
+     def getInputList(self):
+         """Gets a :class:`collada.source.InputList` representing the inputs from a primitive"""
+         inpl = InputList()
+-        for (key, tupes) in self.sources.iteritems():
++        for (key, tupes) in self.sources.items():
+             for (offset, semantic, source, set, srcobj) in tupes:
+                 inpl.addInput(offset, semantic, source, set)
+         return inpl
+diff --git a/collada/tests/test_collada.py b/collada/tests/test_collada.py
+index 7bc5d35..b3cd186 100644
+--- a/collada/tests/test_collada.py
++++ b/collada/tests/test_collada.py
+@@ -46,6 +46,10 @@ def test_collada_duck_tris(self):
+         self.assertEqual(len(mesh.nodes), 0)
+         self.assertIn('VisualSceneNode', mesh.scenes)
+ 
++        triset = mesh.geometries[0].primitives[0]
++        input_list = triset.getInputList().getList()
++        self.assertEqual(3, len(input_list))
++
+         self.assertIsNotNone(str(list(mesh.scene.objects('geometry'))))
+         self.assertIsNotNone(str(list(mesh.scene.objects('light'))))
+         self.assertIsNotNone(str(list(mesh.scene.objects('camera'))))
diff --git a/python-collada.spec b/python-collada.spec
index 59b2f53..a344136 100644
--- a/python-collada.spec
+++ b/python-collada.spec
@@ -3,7 +3,7 @@
 
 Name:           python-collada
 Version:        0.4
-Release:        6%{?dist}
+Release:        7%{?dist}
 Summary:        A python module for creating, editing and loading COLLADA
 Group:          Development/Languages
 
@@ -13,6 +13,8 @@ URL:            https://github.com/pycollada/pycollada
 Source0:        %{realname}-%{version}.tar.gz
 # Disable pypi downloads in setup.py to guarantee use of only system libs
 Patch0:         python-collada-0.4-disable_unittest_downloads.patch
+# https://github.com/pycollada/pycollada/issues/40
+Patch1:         python-collada-py34.patch
 
 BuildArch:      noarch
 
@@ -70,6 +72,7 @@ as well as in-place editing.
 %patch0 -p1 -z .no_downloads
 
 %if 0%{?with_python3}
+%patch1 -p1 -b .py34
 rm -rf %{py3dir}
 cp -a . %{py3dir}
 %endif # with_python3
@@ -120,6 +123,9 @@ popd
 
 
 %changelog
+* Wed Oct  1 2014 Richard Shaw <hobbes1069 at gmail.com> - 0.4-7
+- Fix error for Python 3.4.
+
 * Mon Sep  8 2014 Richard Shaw <hobbes1069 at gmail.com> - 0.4-6
 - Add Python 3 support.
 


More information about the scm-commits mailing list