mirror of https://github.com/testerSunshine/12306
fix
parent
33322cc472
commit
8458017498
|
@ -75,7 +75,7 @@ class proxy:
|
|||
for i in lins:
|
||||
p = i.strip("\n")
|
||||
self.proxy_filter_list.append(p)
|
||||
except TypeError:
|
||||
except Exception:
|
||||
with open(path, "r", ) as f:
|
||||
lins = f.readlines()
|
||||
for i in lins:
|
||||
|
|
|
@ -74,7 +74,7 @@ class CDNProxy:
|
|||
if i and "kyfw.12306.cn:443" not in i:
|
||||
cdn.append(i.replace("\n", ""))
|
||||
return cdn
|
||||
except TypeError:
|
||||
except Exception:
|
||||
with open(path, "r") as f:
|
||||
for i in f.readlines():
|
||||
# print(i.replace("\n", ""))
|
||||
|
|
|
@ -15,7 +15,7 @@ def _get_yaml():
|
|||
try: # 兼容2和3版本
|
||||
with open(path, encoding="utf-8") as f:
|
||||
s = yaml.load(f)
|
||||
except TypeError:
|
||||
except Exception:
|
||||
with open(path) as f:
|
||||
s = yaml.load(f)
|
||||
return s.decode() if isinstance(s, bytes) else s
|
||||
|
|
|
@ -140,7 +140,7 @@ class select:
|
|||
try:
|
||||
with open(path, encoding="utf-8") as result:
|
||||
info = result.read().split('=')[1].strip("'").split('@')
|
||||
except TypeError:
|
||||
except Exception:
|
||||
with open(path) as result:
|
||||
info = result.read().split('=')[1].strip("'").split('@')
|
||||
del info[0]
|
||||
|
|
|
@ -29,7 +29,7 @@ def getPassCodeNewOrderAndLogin(session, imgType):
|
|||
try:
|
||||
with open(img_path, 'wb', encoding="utf-8") as img:
|
||||
img.write(result)
|
||||
except TypeError:
|
||||
except Exception:
|
||||
with open(img_path, 'wb') as img:
|
||||
img.write(result)
|
||||
return result
|
||||
|
|
Loading…
Reference in New Issue