Skip to content

Commit e4de678

Browse files
bors[bot]sanders41
andauthored
Merge #111
111: Removed unreachable code r=bidoubiwa a=sanders41 In both cases where I removed the `sys.exit` line there is a `raise` immediately preceding it so it is impossible to reach the `sys.exit` Co-authored-by: Paul Sanders <[email protected]>
2 parents db012ed + eccbf4f commit e4de678

File tree

2 files changed

+0
-4
lines changed

2 files changed

+0
-4
lines changed

scraper/src/config/config_loader.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
from collections import OrderedDict
99
import json
1010
import os
11-
import sys
1211
import copy
1312

1413
from .config_validator import ConfigValidator
@@ -102,7 +101,6 @@ def _load_config(self, config):
102101
return data
103102
except ValueError as value_error:
104103
raise ValueError('CONFIG is not a valid JSON') from value_error
105-
sys.exit(EXIT_CODE_WRONG_CONFIG)
106104

107105
def _parse(self):
108106
# Parse Env

scraper/src/documentation_spider.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from scrapy.spiders.sitemap import regex
1111
import re
1212
import os
13-
import sys
1413

1514
# End of import for the sitemap behavior
1615

@@ -160,7 +159,6 @@ def add_records(self, response, from_sitemap):
160159
self.reason_to_stop = "Too much hits, Docs-Scraper only handle {} records".format(
161160
int(self.nb_hits_max))
162161
raise ValueError(self.reason_to_stop)
163-
sys.exit(EXIT_CODE_EXCEEDED_RECORDS)
164162

165163
def parse_from_sitemap(self, response):
166164
if self.reason_to_stop is not None:

0 commit comments

Comments
 (0)