pull/214/head
wenxianping 2019-01-17 15:33:10 +08:00
parent 33322cc472
commit 8458017498
5 changed files with 5 additions and 5 deletions

View File

@ -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:

View File

@ -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", ""))

View File

@ -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

View File

@ -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]

View File

@ -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