[Piglit] [PATCH 1/3] Make ExecTest's test name splitting more Unicode-proof.

Kenneth Graunke kenneth at whitecape.org
Wed Dec 21 11:46:24 PST 2011


If by some bizarre circumstance, self.command were to be unicode, this
would fail because type(self.command) wouldn't be types.StringType.

Also, I don't think shlex.split handles unicode, so just convert it.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
 framework/exectest.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/framework/exectest.py b/framework/exectest.py
index d783fa5..ca4774a 100644
--- a/framework/exectest.py
+++ b/framework/exectest.py
@@ -37,8 +37,8 @@ class ExecTest(Test):
 		self.command = command
 		self.env = {}
 
-		if type(self.command) is types.StringType:
-			self.command = shlex.split(self.command)
+		if isinstance(self.command, basestring):
+			self.command = shlex.split(str(self.command))
 
 	def interpretResult(self, out, results):
 		raise NotImplementedError
-- 
1.7.7.3



More information about the Piglit mailing list