Use "except as e" syntax so it also works with Python 3.x.