add AST helpers for compatibility with Python 2.5
do not report the same extension multiple times