From 0a54e15fd30c2a5d40641f2f0ecdac2789bb4ec9 Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Wed, 26 Nov 2014 14:33:12 -0600
Subject: [PATCH] Progress on native-Py3

---
 loopy/auto_test.py    |  2 +-
 loopy/check.py        |  2 +-
 loopy/codegen/loop.py |  2 +-
 loopy/compiled.py     |  2 +-
 loopy/schedule.py     | 20 ++++++++++----------
 5 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/loopy/auto_test.py b/loopy/auto_test.py
index 8497f0c5e..f08a95614 100644
--- a/loopy/auto_test.py
+++ b/loopy/auto_test.py
@@ -425,7 +425,7 @@ def auto_test_vs_ref(
                             ref_queue, parameters,
                             fill_value=fill_value_ref)
             ref_args["out_host"] = False
-        except cl.RuntimeError, e:
+        except cl.RuntimeError as e:
             if e.code == cl.status_code.IMAGE_FORMAT_NOT_SUPPORTED:
                 import traceback
                 ref_errors.append("\n".join([
diff --git a/loopy/check.py b/loopy/check.py
index 715a0740c..45e429450 100644
--- a/loopy/check.py
+++ b/loopy/check.py
@@ -394,7 +394,7 @@ def check_sizes(kernel, device):
     try:
         glens = evaluate(glens, parameters)
         llens = evaluate(llens, parameters)
-    except UnknownVariableError, name:
+    except UnknownVariableError as name:
         from warnings import warn
         warn("could not check axis bounds because no value "
                 "for variable '%s' was passed to check_kernels()"
diff --git a/loopy/codegen/loop.py b/loopy/codegen/loop.py
index 2004fe215..c3b2881ad 100644
--- a/loopy/codegen/loop.py
+++ b/loopy/codegen/loop.py
@@ -129,7 +129,7 @@ def generate_unroll_loop(kernel, sched_index, codegen_state):
         lower_bound_aff = static_value_of_pw_aff(
                 bounds.lower_bound_pw_aff.coalesce(),
                 constants_only=False)
-    except Exception, e:
+    except Exception as e:
         raise type(e)("while finding lower bound of '%s': " % iname)
 
     result = []
diff --git a/loopy/compiled.py b/loopy/compiled.py
index da3269bba..3e6b50647 100644
--- a/loopy/compiled.py
+++ b/loopy/compiled.py
@@ -163,7 +163,7 @@ def generate_integer_arg_finding_from_shapes(gen, kernel, impl_arg_info, options
                                     [integer_arg_var.name],
                                     [(shape_i, sym_shape.index(axis_nr))]
                                     )[integer_arg_var]
-                        except Exception, e:
+                        except Exception as e:
                             #from traceback import print_exc
                             #print_exc()
 
diff --git a/loopy/schedule.py b/loopy/schedule.py
index c570e6d20..62ab00fc5 100644
--- a/loopy/schedule.py
+++ b/loopy/schedule.py
@@ -355,10 +355,10 @@ def generate_loop_schedules_internal(sched_state, loop_priority, schedule=[],
         print("(LEGEND: entry into loop: <iname>, exit from loop: </iname>, "
                 "instructions w/ no delimiters)")
         #print("boost allowed:", allow_boost)
-        print(75*"="
+        print(75*"=")
         print("LOOP NEST MAP:")
         for iname, val in sched_state.loop_nest_map.iteritems():
-            print("%s : %s" % (iname, ", ".join(val))
+            print("%s : %s" % (iname, ", ".join(val)))
         print(75*"=")
         print("WHY IS THIS A DEAD-END SCHEDULE?")
 
@@ -1079,18 +1079,18 @@ def generate_loop_schedules(kernel, debug_args={}):
 
     if not schedule_count:
         if debug.interactive:
-            print(75*"-"
-            print("ERROR: Sorry--loo.py did not find a schedule for your kernel."
-            print(75*"-"
-            print("Loo.py will now show you the scheduler state at the point"
-            print("where the longest (dead-end) schedule was generated, in the"
-            print("the hope that some of this makes sense and helps you find"
-            print("the issue."
+            print(75*"-")
+            print("ERROR: Sorry--loo.py did not find a schedule for your kernel.")
+            print(75*"-")
+            print("Loo.py will now show you the scheduler state at the point")
+            print("where the longest (dead-end) schedule was generated, in the")
+            print("the hope that some of this makes sense and helps you find")
+            print("the issue.")
             print()
             print("To disable this interactive behavior, pass")
             print("  debug_args=dict(interactive=False)")
             print("to generate_loop_schedules().")
-            print(75*"-"
+            print(75*"-")
             six.input("Enter:")
             print()
             print()
-- 
GitLab