Skip to contentSkip to conversation

list-workarounds: Convert to python3

PATCH In review Ben Widawsky 3 participants 4 messages May 10, 2013 – May 11, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 list-workarounds: Convert to python3

The rest of the tool suite that uses python already uses python3. The tool configure requires python >= 3 (which is confusing because of the no backward compat problem).

The world is slowly moving to python3.

Converted with 2to3.

CC Damien Lespiau <[email protected]>
CC Kenneth Graunke <[email protected]>
---
 scripts/list-workarounds | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
scripts/list-workarounds +4 -4
index 6c8c636..b874fd8 100755
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 import os,sys
 import optparse
@@ -29,7 +29,7 @@ wa_re = re.compile('(?P<name>Wa[A-Z0-9][a-zA-Z0-9_]+):(?P<platforms>[a-z,]+)')
 waname_re = re.compile('(?P<name>Wa[A-Z0-9][a-zA-Z0-9_]+)')
 def parse(me):
 	for line in me.splitlines():
-		match = wa_re.search(line)
+		match = wa_re.search(str(line))
 		if not match:
 			if not verbose:
 				continue
@@ -103,8 +103,8 @@ if __name__ == '__main__':
 		sys.exit(1)
 
 	parse(work_arounds)
-	for wa in sorted(workarounds.iterkeys()):
+	for wa in sorted(workarounds.keys()):
 		if not options.platform:
-			print("%s: %s" % (wa, ', '.join(workarounds[wa])))
+			print(("%s: %s" % (wa, ', '.join(workarounds[wa]))))
 		elif options.platform in workarounds[wa]:
 			print(wa)
Signature · 1 line
1.8.2.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Ben Widawsky

The rest of the tool suite that uses python already uses python3. The tool configure requires python >= 3 (which is confusing because of the no backward compat problem).

The world is slowly moving to python3.

Converted with 2to3.

CC Damien Lespiau <[email protected]>
CC Kenneth Graunke <[email protected]>
Reviewed-by on v1 1/1
#2 lore raw
In reply to Ben Widawsky

scripts/list-workarounds if __name__ == '__main__': · line 108

Quoted 2 lines · Ben Widawsky
scripts/list-workarounds +1 -1
-			print("%s: %s" % (wa, ', '.join(workarounds[wa])))
+			print(("%s: %s" % (wa, ', '.join(workarounds[wa]))))

This one adds extra () that are not necessary. Other than that, ship it!

Signature · 1 line
Damien
#3 lore raw
Quoted 10 lines · Damien Lespiau

scripts/list-workarounds if __name__ == '__main__': · line 108

Quoted 2 lines · Ben Widawsky
scripts/list-workarounds +1 -1
-			print("%s: %s" % (wa, ', '.join(workarounds[wa])))
+			print(("%s: %s" % (wa, ', '.join(workarounds[wa]))))

This one adds extra () that are not necessary. Other than that, ship it!

Signature · 1 line
Damien

Yeah, weird, not sure why 2to3 did that... Removed, and pushed. Thanks.

Signature · 1 line
Ben Widawsky, Intel Open Source Technology Center