File: python3.patch

package info (click to toggle)
harp 1.26-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 57,780 kB
  • sloc: xml: 476,214; ansic: 170,387; sh: 4,898; yacc: 2,186; javascript: 1,510; python: 1,145; makefile: 653; lex: 591
file content (31 lines) | stat: -rw-r--r-- 802 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
--- a/python/_harppy.py
+++ b/python/_harppy.py
@@ -34,6 +34,7 @@
 import glob
 import numpy
 import os
+from functools import reduce
 
 try:
     from cStringIO import StringIO
@@ -277,7 +278,7 @@
         return name in self._variable_dict
 
     def __repr__(self):
-        return "<Product variables=%r>" % self._variable_dict.keys()
+        return "<Product variables=%r>" % list(self._variable_dict.keys())
 
     def __str__(self):
         stream = StringIO()
@@ -472,9 +473,9 @@
     This method is Python 2 and Python 3 compatible.
     """
     try:
-        return dictionary.iteritems()
+        return iter(list(dictionary.items()))
     except AttributeError:
-        return dictionary.items()
+        return list(dictionary.items())
 
 
 def _get_py_dimension_type(dimension_type):