From de64a1f68afe24a246152f778b7f3b236b9ae439 Mon Sep 17 00:00:00 2001 From: Felipe Ruhland Date: Tue, 19 Jul 2016 00:04:45 -0300 Subject: [PATCH] Fix scrapy.cfg validation Signed-off-by: Felipe Ruhland --- scrapy/commands/startproject.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scrapy/commands/startproject.py b/scrapy/commands/startproject.py index 0940d67f9..2218bd134 100644 --- a/scrapy/commands/startproject.py +++ b/scrapy/commands/startproject.py @@ -79,10 +79,11 @@ class Command(ScrapyCommand): if len(args) == 2: project_dir = args[1] - if exists(join(project_dir, 'scrapy.cfg')): - self.exitcode = 1 - print('Error: scrapy.cfg already exists in %s' % abspath(project_dir)) - return + + if exists(join(project_dir, 'scrapy.cfg')): + self.exitcode = 1 + print('Error: scrapy.cfg already exists in %s' % abspath(project_dir)) + return if not self._is_valid_name(project_name): self.exitcode = 1