Skip to content

Commit 9fc126f

Browse files
committed
use globals
1 parent 90f1ad8 commit 9fc126f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

scripts/pypi_cleanup.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
import requests
1515
from requests.exceptions import RequestException
1616

17+
_PYPI_URL_PROD = 'https://pypi.org/'
18+
_PYPI_URL_TEST = 'https://test.pypi.org/'
19+
1720
def valid_hostname(hostname):
1821
"""Validate hostname format"""
1922
if len(hostname) > 253:
@@ -63,12 +66,10 @@ def non_empty_string(value):
6366
dry_run = args.dry
6467
pypi_username = args.username
6568
max_dev_releases = args.max_nightlies
66-
host = None
6769
if args.prod:
68-
host = 'pypi.org'
69-
elif args.test:
70-
host = 'test.pypi.org'
71-
pypi_url = 'https://{}/'.format(host)
70+
pypi_url = _PYPI_URL_PROD
71+
else:
72+
pypi_url = _PYPI_URL_TEST
7273
pypi_password = password
7374
pypi_otp = otp
7475

0 commit comments

Comments
 (0)