Take into account that setuptools is no longer optional

This commit is contained in:
Florent Xicluna 2013-02-20 18:44:17 +01:00
parent be9f2a5ffb
commit 1496579fb2

View file

@ -2,6 +2,8 @@
import os import os
import sys import sys
import setuptools
from flake8.engine import get_style_guide from flake8.engine import get_style_guide
if sys.platform.startswith('win'): if sys.platform.startswith('win'):
@ -53,12 +55,7 @@ def check_code(code, ignore=(), complexity=-1, reporter=None):
return flake8_style.input_file('-', lines=code.split('\n')) return flake8_style.input_file('-', lines=code.split('\n'))
try: class Flake8Command(setuptools.Command):
from setuptools import Command
except ImportError:
Flake8Command = None
else:
class Flake8Command(Command):
description = "Run flake8 on modules registered in setuptools" description = "Run flake8 on modules registered in setuptools"
user_options = [] user_options = []