[Piglit] [PATCH piglit 2/2] Cleanup unnecessary imports.

Ian Romanick idr at freedesktop.org
Tue Oct 11 14:45:25 PDT 2011


On 10/11/2011 11:43 AM, Matěj Cepl wrote:
> While browsing through the code, I found plenty of unnecessary imports in
> places where they were unnecessary.
>
> Signed-off-by: Matěj Cepl<mcepl at redhat.com>
> ---
>   framework/core.py               |    3 ++-
>   tests/all.tests                 |    1 -
>   tests/external-glslparser.tests |    4 +---
>   tests/quick-driver.tests        |    7 +------
>   tests/quick.tests               |    6 +-----
>   tests/r300.tests                |    3 +--
>   tests/r500.tests                |    3 +--
>   tests/r600.tests                |    3 +--
>   8 files changed, 8 insertions(+), 22 deletions(-)
>
> diff --git a/framework/core.py b/framework/core.py
> index e6d9b4d..bd63079 100644
> --- a/framework/core.py
> +++ b/framework/core.py
> @@ -25,7 +25,7 @@
>
>   import errno
>   import json
> -import os
> +import os, os.path
>   import platform
>   import stat
>   import subprocess
> @@ -200,6 +200,7 @@ def checkDir(dirname, failifexists):
>   		os.makedirs(dirname)
>   	except OSError, e:
>   		if e.errno != errno.EEXIST:
> +			print>>sys.stderr, "Exception: %s" % e
>   			raise
>

These two hunks look spurious.  It doesn't seem like they're cleaning up 
any unnecessay imports. :)

>   if 'PIGLIT_BUILD_DIR' in os.environ:
> diff --git a/tests/all.tests b/tests/all.tests
> index beb5d43..ada3fa6 100644
> --- a/tests/all.tests
> +++ b/tests/all.tests
> @@ -5,7 +5,6 @@
>   import os
>   import os.path as path
>   import re
> -import subprocess
>
>   from framework.core import *
>   from framework.exectest import *
> diff --git a/tests/external-glslparser.tests b/tests/external-glslparser.tests
> index f8ea1ac..087807e 100644
> --- a/tests/external-glslparser.tests
> +++ b/tests/external-glslparser.tests
> @@ -2,9 +2,7 @@
>   # -*- coding: utf-8 -*-
>   # All tests that come with piglit, using default settings
>
> -import os
> -import re
> -import subprocess
> +import os.path
>
>   from framework.core import *
>   from framework.exectest import *
> diff --git a/tests/quick-driver.tests b/tests/quick-driver.tests
> index 8d05ee3..adfa89d 100644
> --- a/tests/quick-driver.tests
> +++ b/tests/quick-driver.tests
> @@ -1,12 +1,7 @@
>   #!/usr/bin/env python
>   # -*- coding: utf-8 -*-
>
> -import re
> -import subprocess
> -
> -from framework.core import *
> -from framework.exectest import *
> -from framework.gleantest import *
> +import os.path
>
>   execfile(os.path.dirname(__file__) + '/quick.tests')
>
> diff --git a/tests/quick.tests b/tests/quick.tests
> index b2c3212..702a69f 100644
> --- a/tests/quick.tests
> +++ b/tests/quick.tests
> @@ -4,14 +4,10 @@
>   # Testing drivers for Radeon hardware
>   #
>
> -import os
> -import re
> +import os.path
>
>   execfile(os.path.dirname(__file__) + '/all.tests')
>
> -from framework.core import *
> -from framework.gleantest import *
> -
>   GleanTest.globalParams += [ "--quick" ]
>
>   del profile.tests['valgrind']
> diff --git a/tests/r300.tests b/tests/r300.tests
> index ac8096a..7b40460 100644
> --- a/tests/r300.tests
> +++ b/tests/r300.tests
> @@ -3,8 +3,7 @@
>   # Testing the r300 DRI driver
>   #
>
> -import os
> -import re
> +import os.path
>
>   execfile(os.path.dirname(__file__) + '/quick-driver.tests')
>
> diff --git a/tests/r500.tests b/tests/r500.tests
> index 32c8d5b..7276ac2 100644
> --- a/tests/r500.tests
> +++ b/tests/r500.tests
> @@ -3,8 +3,7 @@
>   # Testing the r500 DRI driver
>   #
>
> -import os
> -import re
> +import os.path
>
>   execfile(os.path.dirname(__file__) + '/quick-driver.tests')
>
> diff --git a/tests/r600.tests b/tests/r600.tests
> index 1b7bc7f..fe7426f 100644
> --- a/tests/r600.tests
> +++ b/tests/r600.tests
> @@ -1,7 +1,6 @@
>   #!/usr/bin/env python
>
> -import os
> -import re
> +import os.path
>
>   execfile(os.path.dirname(__file__) + '/quick-driver.tests')
>



More information about the Piglit mailing list