From 6d1b1425bd3f7b04e1ce0effe81034c51f69074a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrico=20Tr=C3=B6ger?= Date: Sun, 31 Jan 2010 14:23:04 +0000 Subject: [PATCH] Make the script a bit more robust with newer Python versions. git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4597 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- ChangeLog | 10 ++++++++++ scripts/create_py_tags.py | 7 +++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index a1747ac8b..57c6f5627 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2010-01-31 Enrico Tröger + + * icons/Makefile.am: + Include geany.ico in the distribution tarball. + * Makefile.am: + Fix 'make distcheck' by removing data/latex.tags from EXTRA_DIST. + * scripts/create_py_tags.py: + Make the script a bit more robust with newer Python versions. + + 2010-01-31 Frank Lanitz * plugins/export.c: diff --git a/scripts/create_py_tags.py b/scripts/create_py_tags.py index 22f1c8650..94e94040c 100755 --- a/scripts/create_py_tags.py +++ b/scripts/create_py_tags.py @@ -141,14 +141,17 @@ class Parser: name = obj.__name__ except AttributeError: name = obj_name - if not name or name.startswith('_'): + if not name or not isinstance(name, basestring) or name.startswith('_'): # skip non-public tags continue; if inspect.isfunction(obj): self._add_tag(obj, TYPE_FUNCTION) elif inspect.isclass(obj): self._add_tag(obj, TYPE_CLASS, self._get_superclass(obj)) - methods = inspect.getmembers(obj, inspect.ismethod) + try: + methods = inspect.getmembers(obj, inspect.ismethod) + except AttributeError: + methods = [] for m_name, m_obj in methods: # skip non-public tags if m_name.startswith('_') or not inspect.ismethod(m_obj):