27
27
# noinspection PyAttributeOutsideInit
28
28
class Nse :
29
29
version : str = '5.2'
30
- beta : Tuple [bool , int ] = (True , 11 )
30
+ beta : Tuple [bool , int ] = (True , 12 )
31
31
32
32
def __init__ (self , window : Tk ) -> None :
33
33
self .intervals : List [int ] = [1 , 2 , 3 , 5 , 10 , 15 ]
@@ -115,11 +115,7 @@ def get_icon(self) -> None:
115
115
except AttributeError :
116
116
if self .load_nse_icon :
117
117
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 )
123
119
with open ('.NSE-OCA.png' , 'wb' ) as f :
124
120
for chunk in icon_png_raw .iter_content (1024 ):
125
121
f .write (chunk )
@@ -131,11 +127,8 @@ def get_icon(self) -> None:
131
127
return
132
128
if is_windows_10 :
133
129
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 )
139
132
with open ('.NSE-OCA.ico' , 'wb' ) as f :
140
133
for chunk in icon_ico_raw .iter_content (1024 ):
141
134
f .write (chunk )
0 commit comments