[Scipy-svn] r6517 - trunk/scipy/weave
scipy-svn at scipy.org
scipy-svn at scipy.org
Thu Jun 17 09:25:14 EDT 2010
Author: rgommers
Date: 2010-06-17 08:25:14 -0500 (Thu, 17 Jun 2010)
New Revision: 6517
Modified:
trunk/scipy/weave/blitz_tools.py
trunk/scipy/weave/bytecodecompiler.py
Log:
BUG: string exceptions are invalid syntax in Python >=2.6. Fixes #1193.
Modified: trunk/scipy/weave/blitz_tools.py
===================================================================
--- trunk/scipy/weave/blitz_tools.py 2010-06-17 12:53:02 UTC (rev 6516)
+++ trunk/scipy/weave/blitz_tools.py 2010-06-17 13:25:14 UTC (rev 6517)
@@ -32,7 +32,10 @@
# of time. It also can cause core-dumps if the sizes of the inputs
# aren't compatible.
if check_size and not size_check.check_expr(expr,local_dict,global_dict):
- raise 'inputs failed to pass size check.'
+ if sys.version_info < (2, 6):
+ raise "inputs failed to pass size check."
+ else:
+ raise ValueError("inputs failed to pass size check.")
# 2. try local cache
try:
Modified: trunk/scipy/weave/bytecodecompiler.py
===================================================================
--- trunk/scipy/weave/bytecodecompiler.py 2010-06-17 12:53:02 UTC (rev 6516)
+++ trunk/scipy/weave/bytecodecompiler.py 2010-06-17 13:25:14 UTC (rev 6517)
@@ -6,6 +6,7 @@
#**************************************************************************#
#* *#
#**************************************************************************#
+import sys
import inspect
import accelerate_tools
@@ -237,7 +238,10 @@
elif goto is None:
return next # Normal
else:
- raise 'xx'
+ if sys.version_info < (2, 6):
+ raise "Executing code failed."
+ else:
+ raise ValueError("Executing code failed.")
symbols = { 0: 'less', 1: 'lesseq', 2: 'equal', 3: 'notequal',
4: 'greater', 5: 'greatereq', 6: 'in', 7: 'not in',
@@ -977,7 +981,6 @@
var_name = self.codeobject.co_names[var_num]
# First, figure out who owns this global
- import sys
myHash = id(self.function.func_globals)
for module_name in sys.modules.keys():
module = sys.modules[module_name]
More information about the Scipy-svn
mailing list