Skip to content

Commit

Permalink
BF: robustify printout of svmc.__version__ which might not be avail
Browse files Browse the repository at this point in the history
  • Loading branch information
yarikoptic committed Apr 30, 2012
1 parent 0b386d6 commit 0af6853
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mvpa2/clfs/libsvmc/_svm.py
Expand Up @@ -408,8 +408,11 @@ def save(self, filename):


def __del__(self): def __del__(self):
if __debug__: if __debug__:
debug('SVM_', 'Destroying libsvm v. %s SVMModel %s' # TODO: place libsvm versioning information into externals
% (svmc.__version__, `self`)) debug('SVM_', 'Destroying libsvm v. %s SVMModel %s',
(hasattr(svmc, '__version__') \
and svmc.__version__ or "unknown",
`self`))
try: try:
svmc.svm_destroy_model_helper(self.model) svmc.svm_destroy_model_helper(self.model)
except Exception, e: except Exception, e:
Expand Down

0 comments on commit 0af6853

Please sign in to comment.