]> gitweb.michael.orlitzky.com - sage.d.git/blobdiff - mjo/eja/eja_algebra.py
eja: fix recent hasattr() commit.
[sage.d.git] / mjo / eja / eja_algebra.py
index 8e522527413b89c0e704687583dc9c4636303170..e6aba200a90a0317150bde9093f6a28569d2db74 100644 (file)
@@ -779,13 +779,11 @@ class FiniteDimensionalEJA(CombinatorialFreeModule):
             if elt.parent().superalgebra() == self:
                 return elt.superalgebra_element()
 
-        try:
-            # Try to convert a vector into a column-matrix...
+        if hasattr(elt, 'sparse_vector'):
+            # Convert a vector into a column-matrix. We check for
+            # "sparse_vector" and not "column" because matrices also
+            # have a "column" method.
             elt = elt.column()
-        except (AttributeError, TypeError):
-            # and ignore failure, because we weren't really expecting
-            # a vector as an argument anyway.
-            pass
 
         if elt not in self.matrix_space():
             raise ValueError(msg)