Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
vivien8261 committed Jan 5, 2024
1 parent d513466 commit 9308d31
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions amiyabot/adapters/tencent/qqGroup/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def headers(self):
headers={
'Content-Type': 'application/json',
},
timeout=3,
)
data = json.loads(res.text)

Expand Down
2 changes: 1 addition & 1 deletion amiyabot/adapters/tencent/qqGroup/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def remove_file(self, url: str):
del self.file_caches[url]

async def get_image(self, image: Union[str, bytes]) -> Union[str, bytes]:
if type(image) is bytes:
if isinstance(image, bytes):
path, url = self.temp_filename('png')

with open(path, mode='wb') as f:
Expand Down
4 changes: 2 additions & 2 deletions amiyabot/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ def dhash_image(image: bytes, size: int = 8):

def get_public_ip():
try:
response = requests.get('https://api.ipify.org')
response = requests.get('https://api.ipify.org', timeout=3)
return response.text
except Exception as e:
except Exception:
pass
return '127.0.0.1'

0 comments on commit 9308d31

Please sign in to comment.