From 06db4e10e5acd6e12cb5d602125725e30adae194 Mon Sep 17 00:00:00 2001 From: Florent Xicluna Date: Sat, 30 Mar 2013 16:25:50 +0100 Subject: [PATCH] Fix for Python 2.5 compatibility; issue #98. --- flake8/engine.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/flake8/engine.py b/flake8/engine.py index cd2b62c..8d1ac08 100644 --- a/flake8/engine.py +++ b/flake8/engine.py @@ -85,7 +85,8 @@ def get_style_guide(**kwargs): def get_python_version(): - return '%s %s on %s' % ( - platform.python_implementation(), platform.python_version(), - platform.system() - ) + try: + impl = platform.python_implementation() + except AttributeError: # Python 2.5 + impl = 'Python' + return '%s %s on %s' % (impl, platform.python_version(), platform.system())