Skip to content

Commit cef8ab8

Browse files
committed
Don't lowercase all of self.proxy
1 parent 451c2bf commit cef8ab8

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="yagooglesearch",
8-
version="1.8.0",
8+
version="1.8.1",
99
author="Brennon Thomas",
1010
author_email="info@opsdisk.com",
1111
description="A Python library for executing intelligent, realistic-looking, and tunable Google searches.",

yagooglesearch/__init__.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import logging
33
import os
44
import random
5-
import sys
65
import time
76
import urllib
87

@@ -12,7 +11,7 @@
1211

1312
# Custom Python libraries.
1413

15-
__version__ = "1.8.0"
14+
__version__ = "1.8.1"
1615

1716
# Logging
1817
ROOT_LOGGER = logging.getLogger("yagooglesearch")
@@ -208,18 +207,18 @@ def __init__(
208207

209208
# Update proxy_dict if a proxy is provided.
210209
if proxy:
211-
# Standardize case since the scheme will be checked against a hard-coded list.
212-
self.proxy = proxy.lower()
210+
self.proxy = proxy
213211

214212
urllib_object = urllib.parse.urlparse(self.proxy)
215-
scheme = urllib_object.scheme
213+
# Standardize case since the scheme will be checked against a hard-coded list.
214+
scheme = urllib_object.scheme.lower()
216215

217216
if scheme not in ["http", "https", "socks5", "socks5h"]:
218217
ROOT_LOGGER.error(
219-
f'The provided proxy scheme ("{scheme}") is not valid and must be either "http", "https", "socks5"'
218+
f'The provided proxy scheme "{scheme}" is not valid and must be either "http", "https", "socks5"'
220219
', or "socks5h"'
221220
)
222-
sys.exit(1)
221+
return []
223222

224223
self.proxy_dict = {
225224
"http": self.proxy,

0 commit comments

Comments
 (0)