Commits

Jason R. Coombs committed 959908d

Added Python 2.7 compatibility

Comments (0)

Files changed (1)

jaraco/net/stats.py

 import argparse
 import importlib
 
+import six
+
 import jaraco.util.itertools
 import dateutil.parser
 from svg.charts import time_series
 	def success(self):
 		return self.type == 'success'
 
-	__bool__ = success
+	__bool__ = __nonzero__ = success
 
 class Reader(object):
 	def __init__(self, filename):
 		self.file = open(filename)
 
 	def get_stats(self):
-		return map(PingResult, self.file)
+		return six.moves.map(PingResult, self.file)
 
 	def __del__(self):
 		self.file.close()
 def get_windows(stats):
 	"Construct rolling windows"
 	windows_ = itertools.islice(windows(stats, n=20), None, None, 10)
-	return map(get_loss_stats, windows_)
+	return six.moves.map(get_loss_stats, windows_)
 
 def main():
 	parser = argparse.ArgumentParser()