Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

Fix scrapy.cfg validation

Felipe Ruhlandde64a1f68afe
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