[io] vview: compatibility with python < 3.5
# Lighter imports before command line parsing
from __future__ import print_function
-import sys, os, json
+import sys
+import os
+import json
import getopt
import math
+if hasattr(math, 'inf'):
+ infinity = math.inf
+else:
+ infinity = float('inf')
+
## Print usage information
def usage(long=False):
print(__doc__); print()
@@ -1023,7 +1030,7 @@ with Hdf5(io_filename=io_filename, mode='r') as io:
# set visibility for all actors associated to a dynamic instance
def set_actors_viz(instance, time):
tob = times_of_birth.get(instance, -1)
- tod = times_of_death.get(instance, math.inf)
+ tod = times_of_death.get(instance, infinity)
if (tob <= time and tod >= time):
for actor in dynamic_actors[instance]:
actor.VisibilityOn()
