Package list python-pauvre / ed9e8e8 debian / patches / 2to3.patch
ed9e8e8

Tree @ed9e8e8 (Download .tar.gz)

2to3.patch @ed9e8e8raw · history · blame

Author: Andreas Tille <tille@debian.org>
Last-Update: Fri, 24 Apr 2020 12:49:17 +0200
Description: Test script somehow remained at Python2 -> fix this using 2to3

Index: python-pauvre/pauvre/lsi/test.py
===================================================================
--- python-pauvre.orig/pauvre/lsi/test.py
+++ python-pauvre/pauvre/lsi/test.py
@@ -3,10 +3,10 @@
 # Email: splichte@princeton.edu
 # Date: 09/02/2013
 
-from lsi import intersection
+from .lsi import intersection
 import random
 import time, sys
-from helper import *
+from .helper import *
 
 ev = 0.00000001
 
@@ -42,20 +42,20 @@ es = False
 now = time.time()
 for seg1 in S:
 	if approx_equal(seg1[0][0], seg1[1][0], ev):
-		print 'VERTICAL SEG'
-		print ''
-		print ''
+		print('VERTICAL SEG')
+		print('')
+		print('')
 		vs = True
 	if approx_equal(seg1[0][1], seg1[1][1], ev):
-		print 'HORIZONTAL SEG'
-		print ''
-		print ''
+		print('HORIZONTAL SEG')
+		print('')
+		print('')
 		hs = True
 	for seg2 in S:
 		if seg1 is not seg2 and segs_equal(seg1, seg2):
-			print 'EQUAL SEGS'
-			print ''
-			print ''
+			print('EQUAL SEGS')
+			print('')
+			print('')
 			es = True
 		if seg1 is not seg2 and (seg2, seg1) not in seen:
 			i = intersect(seg1, seg2)
@@ -68,17 +68,17 @@ for seg1 in S:
 				seen.append((seg1, seg2))
 later = time.time()
 n2time = later-now
-print "Line sweep results:"
+print("Line sweep results:")
 now = time.time()
 lsinters = intersection(S)
 inters = []
-for k, v in lsinters.iteritems():
+for k, v in lsinters.items():
 	#print '{0}: {1}'.format(k, v)
 	inters.append(k)
 #	inters.append(v)
 later = time.time()
-print 'TIME ELAPSED: {0}'.format(later-now)
-print "N^2 comparison results:"
+print('TIME ELAPSED: {0}'.format(later-now))
+print("N^2 comparison results:")
 pts_seen = []
 highestseen = 0
 for i in intersections:
@@ -97,14 +97,14 @@ for i in intersections:
 		if approx_equal(k[0], i[0][0], ev) and approx_equal(k[1], i[0][1], ev):
 			in_k = True
 	if in_k == False:
-		print 'Not in K: {0}: {1}'.format(i[0], i[1])
+		print('Not in K: {0}: {1}'.format(i[0], i[1]))
 #	print i
-print highestseen
-print 'TIME ELAPSED: {0}'.format(n2time)
+print(highestseen)
+print('TIME ELAPSED: {0}'.format(n2time))
 #print 'Missing from line sweep but in N^2:'
 #for i in seen:
 #	matched = False
-print len(lsinters)
-print len(pts_seen)
+print(len(lsinters))
+print(len(pts_seen))
 if len(lsinters) != len(pts_seen):
-	print 'uh oh!'
+	print('uh oh!')