diff --git a/bin/pyplotres.py b/bin/pyplotres.py index 238f24530..db4b1db2f 100755 --- a/bin/pyplotres.py +++ b/bin/pyplotres.py @@ -202,7 +202,7 @@ def get_xdata(self, key): """Return label describing xaxis and the corresponding data given keyword 'key'. """ - if not isinstance(key, bytes): + if not (isinstance(key, bytes) or isinstance(key, str)): raise ValueError("key must be of type string.") xopt = key.lower() if xopt == 'numtoa': @@ -228,7 +228,7 @@ def get_ydata(self, key, postfit=True): 'postfit' is a boolean argument that determines if postfit, or prefit data is to be returned. """ - if not isinstance(key, bytes): + if not (isinstance(key, bytes) or isinstance(key, str)): raise ValueError("key must be of type string.") yopt = key.lower() if postfit: diff --git a/lib/python/residuals.py b/lib/python/residuals.py index f5a9cd2a4..01e9c4560 100644 --- a/lib/python/residuals.py +++ b/lib/python/residuals.py @@ -61,7 +61,7 @@ def read_residuals(filename="resid2.tmp"): not (reclen==struct.calcsize(rectype))): print("Warning: possibly reading residuals incorrectly... don't understand record size") infile.seek(0, 0) # position at file start - r.numTOAs = filelen / reclen + r.numTOAs = int(filelen / reclen) r.bary_TOA = Num.zeros(r.numTOAs, 'd') r.postfit_phs = Num.zeros(r.numTOAs, 'd') r.postfit_sec = Num.zeros(r.numTOAs, 'd')