fix for Python 2.5 compatibility: avoid set.intersection() with multiple parameters, which was introduced in Python 2.6