diff options
author | Emile Anclin <emile.anclin@logilab.fr> | 2010-12-13 18:48:28 +0100 |
---|---|---|
committer | Emile Anclin <emile.anclin@logilab.fr> | 2010-12-13 18:48:28 +0100 |
commit | 9c0e2aa622a8d8f85fae48d6795b4bfabe1ccaa4 (patch) | |
tree | 0e32234bfaa99e1f0b9a9d979cf800402cdf932e /manager.py | |
parent | 5d3f2a5255224c15c316d0854fd9db2b41a201a0 (diff) | |
download | astroid-git-9c0e2aa622a8d8f85fae48d6795b4bfabe1ccaa4.tar.gz |
minor cleanup: remove useless optional attributes
Diffstat (limited to 'manager.py')
-rw-r--r-- | manager.py | 21 |
1 files changed, 10 insertions, 11 deletions
@@ -227,22 +227,21 @@ class ASTNGManager(OptionsProviderMixIn): return modastng.getattr(klass.__name__)[0] # XXX - def infer_astng_from_something(self, obj, modname=None, context=None): + def infer_astng_from_something(self, obj, context=None): """infer astng for the given class""" if hasattr(obj, '__class__') and not isinstance(obj, type): klass = obj.__class__ else: klass = obj - if modname is None: - try: - modname = klass.__module__ - except AttributeError: - raise ASTNGBuildingException( - 'Unable to get module for %s' % safe_repr(klass)) - except Exception, ex: - raise ASTNGBuildingException( - 'Unexpected error while retrieving module for %s: %s' - % (safe_repr(klass), ex)) + try: + modname = klass.__module__ + except AttributeError: + raise ASTNGBuildingException( + 'Unable to get module for %s' % safe_repr(klass)) + except Exception, ex: + raise ASTNGBuildingException( + 'Unexpected error while retrieving module for %s: %s' + % (safe_repr(klass), ex)) try: name = klass.__name__ except AttributeError: |