Skip to content

Commit dcf413a

Browse files
committed
- Removed unnecessary code for handling icon loading error
1 parent c404133 commit dcf413a

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

NSE_Option_Chain_Analyzer.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
# noinspection PyAttributeOutsideInit
2828
class Nse:
2929
version: str = '5.2'
30-
beta: Tuple[bool, int] = (True, 11)
30+
beta: Tuple[bool, int] = (True, 12)
3131

3232
def __init__(self, window: Tk) -> None:
3333
self.intervals: List[int] = [1, 2, 3, 5, 10, 15]
@@ -115,11 +115,7 @@ def get_icon(self) -> None:
115115
except AttributeError:
116116
if self.load_nse_icon:
117117
try:
118-
icon_png_raw: Optional[requests.Response] = requests.get(self.url_icon_png, headers=self.headers,
119-
stream=True)
120-
if icon_png_raw is None:
121-
self.load_nse_icon = False
122-
return
118+
icon_png_raw: requests.Response = requests.get(self.url_icon_png, headers=self.headers, stream=True)
123119
with open('.NSE-OCA.png', 'wb') as f:
124120
for chunk in icon_png_raw.iter_content(1024):
125121
f.write(chunk)
@@ -131,11 +127,8 @@ def get_icon(self) -> None:
131127
return
132128
if is_windows_10:
133129
try:
134-
icon_ico_raw: Optional[requests.Response] = requests.get(self.url_icon_ico,
135-
headers=self.headers, stream=True)
136-
if icon_ico_raw is None:
137-
self.icon_ico_path = None
138-
return
130+
icon_ico_raw: requests.Response = requests.get(self.url_icon_ico,
131+
headers=self.headers, stream=True)
139132
with open('.NSE-OCA.ico', 'wb') as f:
140133
for chunk in icon_ico_raw.iter_content(1024):
141134
f.write(chunk)

0 commit comments

Comments
 (0)