diff options
author | Dylan Baker <baker.dylan.c@gmail.com> | 2016-03-30 11:18:39 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2016-05-02 17:54:04 -0700 |
commit | 5fece51da7eef4893ae6c2fd6d642c41a4ed4e59 (patch) | |
tree | 0f02e72383dbb41fe431641962f4b2a038aabe4b | |
parent | b1ac7983ed1000c9029be724ec0be59c8661073e (diff) |
framework: update the rest of the piglit-* commands to be py3
Convert the rest of the commands using six to make them both python 2
and python 3 safe. This also changes the default chbang to python
instead of python2, which should only be a change on Arch linux.
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
-rwxr-xr-x | piglit-resume.py | 11 | ||||
-rwxr-xr-x | piglit-run.py | 11 | ||||
-rwxr-xr-x | piglit-summary-html.py | 11 | ||||
-rwxr-xr-x | piglit-summary.py | 11 |
4 files changed, 32 insertions, 12 deletions
diff --git a/piglit-resume.py b/piglit-resume.py index 43db8face..93eaa60f9 100755 --- a/piglit-resume.py +++ b/piglit-resume.py @@ -1,6 +1,6 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python -# Copyright (c) 2014 Intel Corporation +# Copyright (c) 2014, 2016 Intel Corporation # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -31,6 +31,11 @@ from __future__ import ( ) import sys +import six + from framework.programs.run import resume -resume([i.decode('utf-8') for i in sys.argv[1:]]) +if six.PY2: + resume([i.decode('utf-8') for i in sys.argv[1:]]) +elif six.PY3: + resume(sys.argv[1:]) diff --git a/piglit-run.py b/piglit-run.py index d1bd69d2c..8b5c51efb 100755 --- a/piglit-run.py +++ b/piglit-run.py @@ -1,6 +1,6 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python -# Copyright (c) 2014 Intel Corporation +# Copyright (c) 2014, 2016 Intel Corporation # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -31,6 +31,11 @@ from __future__ import ( ) import sys +import six + from framework.programs.run import run -run([i.decode('utf-8') for i in sys.argv[1:]]) +if six.PY2: + run([i.decode('utf-8') for i in sys.argv[1:]]) +elif six.PY3: + run(sys.argv[1:]) diff --git a/piglit-summary-html.py b/piglit-summary-html.py index cb4e78cfc..81a7d24ee 100755 --- a/piglit-summary-html.py +++ b/piglit-summary-html.py @@ -1,6 +1,6 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python -# Copyright (c) 2014 Intel Corporation +# Copyright (c) 2014, 2016 Intel Corporation # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -27,6 +27,11 @@ from __future__ import ( ) import sys +import six + from framework.programs.summary import html -html([i.decode('utf-8') for i in sys.argv[1:]]) +if six.PY2: + html([i.decode('utf-8') for i in sys.argv[1:]]) +elif six.PY3: + html(sys.argv[1:]) diff --git a/piglit-summary.py b/piglit-summary.py index 307d804dd..08739ba4d 100755 --- a/piglit-summary.py +++ b/piglit-summary.py @@ -1,6 +1,6 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python -# Copyright (c) 2014 Intel Corporation +# Copyright (c) 2014, 2016 Intel Corporation # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -27,6 +27,11 @@ from __future__ import ( ) import sys +import six + from framework.programs.summary import console -console([i.decode('utf-8') for i in sys.argv[1:]]) +if six.PY2: + console([i.decode('utf-8') for i in sys.argv[1:]]) +elif six.PY3: + console(sys.argv[1:]) |