Skip to content

Commit fb8b87c

Browse files
authored
Refactor requests import handling in download_regions.py
Removed the import error handling for the requests library and added the import statement at the top of the file.
1 parent ad70581 commit fb8b87c

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

scripts/download_regions.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import json
1212
import os
1313
import sys
14+
import requests
1415

1516
REGIONS_URL = 'https://artifacts.contentstack.com/regions.json'
1617

@@ -24,15 +25,6 @@ def download():
2425
dest_dir = os.path.dirname(DEST)
2526
os.makedirs(dest_dir, exist_ok=True)
2627

27-
try:
28-
import requests
29-
except ImportError:
30-
sys.stderr.write(
31-
'contentstack: requests library not available. '
32-
'Install dependencies first: pip install -r requirements.txt\n'
33-
)
34-
sys.exit(1)
35-
3628
print(f'contentstack: Downloading regions.json from {REGIONS_URL} ...')
3729

3830
try:

0 commit comments

Comments
 (0)