Blame SOURCES/mc-python3.patch

9b6e50
diff -up mc-4.8.24/src/vfs/extfs/helpers/uc1541.python3 mc-4.8.24/src/vfs/extfs/helpers/uc1541
9b6e50
--- mc-4.8.24/src/vfs/extfs/helpers/uc1541.python3	2020-01-20 14:40:30.637996501 +0100
9b6e50
+++ mc-4.8.24/src/vfs/extfs/helpers/uc1541	2020-01-20 14:37:55.253442507 +0100
9b6e50
@@ -1,4 +1,4 @@
9b6e50
-#!/usr/bin/env python
9b6e50
+#!/usr/bin/env python3
9b6e50
 """
9b6e50
 UC1541 Virtual filesystem
9b6e50
 
9b6e50
--- a/src/vfs/extfs/helpers/s3+.in	(original)
9b6e50
+++ b/src/vfs/extfs/helpers/s3+.in	(refactored)
9b6e50
@@ -153,16 +153,16 @@
9b6e50
 	Propagates exception safely.
9b6e50
 	"""
9b6e50
 	from threading import Thread
9b6e50
-	import Queue
9b6e50
+	import queue
9b6e50
 
9b6e50
 	items = list(iterable)
9b6e50
 	nitems = len(items)
9b6e50
 	if nitems < 2:
9b6e50
-		return map(fun, items)
9b6e50
+		return list(map(fun, items))
9b6e50
 
9b6e50
 	# Create and fill input queue
9b6e50
-	input = Queue.Queue()
9b6e50
-	output = Queue.Queue()
9b6e50
+	input = queue.Queue()
9b6e50
+	output = queue.Queue()
9b6e50
 
9b6e50
 	for i,item in enumerate(items):
9b6e50
 		input.put( (i,item) )
9b6e50
@@ -181,7 +181,7 @@
9b6e50
 						output.put( (i,result) )
9b6e50
 					except:
9b6e50
 						output.put( (None,sys.exc_info()) )
9b6e50
-				except Queue.Empty:
9b6e50
+				except queue.Empty:
9b6e50
 					return
9b6e50
 
9b6e50
 	# Start threads
9b6e50
@@ -196,8 +196,8 @@
9b6e50
 		try:
9b6e50
 			i,res = output.get()
9b6e50
 			if i == None:
9b6e50
-				raise res[0],res[1],res[2]
9b6e50
-		except Queue.Empty:
9b6e50
+				raise res[0](res[1]).with_traceback(res[2])
9b6e50
+		except queue.Empty:
9b6e50
 			break
9b6e50
 		ret.append(res)
9b6e50
 
9b6e50
@@ -241,7 +241,7 @@
9b6e50
 		b = s3.get_bucket(name, validate=False)
9b6e50
 		b.get_location() # just to raise an exception on error
9b6e50
 		return b
9b6e50
-	except boto.exception.S3ResponseError, e:
9b6e50
+	except boto.exception.S3ResponseError as e:
9b6e50
 		# Seems this is the only proper way to switch to the bucket's region.
9b6e50
 		# Requesting of the default region for "?location" does not work unfortunately.
9b6e50
 		m = re.search(r'<Region>(.*?)</Region>', e.body)
9b6e50
@@ -340,7 +340,7 @@
9b6e50
 	expr = re.compile(r'^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})\.\d{3}Z$')
9b6e50
 	def convDate(awsdatetime):
9b6e50
 		m = expr.match(awsdatetime)
9b6e50
-		ye,mo,da,ho,mi,se = map(int,m.groups())
9b6e50
+		ye,mo,da,ho,mi,se = list(map(int,m.groups()))
9b6e50
 
9b6e50
 		dt = datetime.datetime(ye,mo,da,ho,mi,se, tzinfo=pytz.utc)
9b6e50
 		return dt.astimezone(tz).strftime('%m-%d-%Y %H:%M')