Skip to content

Commit

Permalink
BUG: core: fix _dotblas usage on Py3 (fixes #1609)
Browse files Browse the repository at this point in the history
  • Loading branch information
pv committed Sep 11, 2010
1 parent b74533b commit 3843e86
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
16 changes: 15 additions & 1 deletion numpy/core/tests/test_blasdot.py
@@ -1,5 +1,5 @@
from numpy.core import zeros, float64
from numpy.testing import TestCase, assert_almost_equal
from numpy.testing import dec, TestCase, assert_almost_equal, assert_
from numpy.core.multiarray import inner as inner_

DECPREC = 14
Expand All @@ -12,3 +12,17 @@ def test_vecself(self):
a = zeros(shape = (1, 80), dtype = float64)
p = inner_(a, a)
assert_almost_equal(p, 0, decimal = DECPREC)

try:
import numpy.core._dotblas as _dotblas
except ImportError:
_dotblas = None

@dec.skipif(_dotblas is None, "Numpy is not compiled with _dotblas")
def test_blasdot_used():
from numpy.core import dot, vdot, inner, alterdot, restoredot
assert_(dot is _dotblas.dot)
assert_(vdot is _dotblas.vdot)
assert_(inner is _dotblas.inner)
assert_(alterdot is _dotblas.alterdot)
assert_(restoredot is _dotblas.restoredot)
2 changes: 1 addition & 1 deletion tools/py3tool.py
Expand Up @@ -157,7 +157,7 @@ def custom_mangling(filename):
for mod in ['multiarray', 'scalarmath', 'umath', '_sort',
'_compiled_base', 'core', 'lib', 'testing', 'fft',
'polynomial', 'random', 'ma', 'linalg', 'compat',
'mtrand']:
'mtrand', '_dotblas']:
text = re.sub(r'^(\s*)import %s' % mod,
r'\1from . import %s' % mod,
text, flags=re.M)
Expand Down

0 comments on commit 3843e86

Please sign in to comment.