From: Dylan Baker <baker.dyla...@gmail.com> In python2 one can seek to negatives (-1 is the end of the file, for example). In python 2.6+ (and exclusively in python 3) one instead uses the second argument of seek to say whether to start at the start or end of the file, and then an exact point. So file.seek(-1) -> file.seek(0, 2)
Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com> --- unittests/log_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unittests/log_tests.py b/unittests/log_tests.py index 63aae5e..8a90a21 100644 --- a/unittests/log_tests.py +++ b/unittests/log_tests.py @@ -139,7 +139,7 @@ def check_no_output(func, args, file_=sys.stdout): file_.truncate() func(*args) - file_.seek(-1) + file_.seek(0, 2) nt.eq_(file_.tell(), 0, msg='file.tell() is at {}, but should be at 0'.format(file_.tell())) -- 2.7.0 _______________________________________________ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit