Skip to content

Commit afcf080

Browse files
committed
Bugfix with newer aiohttp versions
1 parent 79af47a commit afcf080

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

pypxl/__init__.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
__title__ = "pypxl"
99
__author__ = "Kile"
1010
__license__ = "MIT"
11-
__copyright__ = "Copyright 2021 Kile"
12-
__version__ = "0.2.3"
11+
__copyright__ = "Copyright 2024 Kile"
12+
__version__ = "0.2.4"
1313

14-
from .client import PxlClient
14+
from .client import PxlClient
15+
from .errors import PxlapiException

pypxl/client.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import aiohttp
2-
import json
32
from .errors import PxlapiException, InvalidFlag, TooManyCharacters, InvalidSafety, InvalidEyes
43
from .pxl_object import PxlObject
54

@@ -16,7 +15,7 @@ class PxlClient:
1615
`session (aiohttp client session)`: The session to use for requests
1716
`stop_on_error (boolean)`: If the code should raise an error if something went wrong or return the error text instead
1817
"""
19-
def __init__(self, token:str, session=aiohttp.ClientSession(), stop_on_error:bool=False) -> PxlObject:
18+
def __init__(self, token:str, session:aiohttp.ClientSession, stop_on_error:bool=False) -> PxlObject:
2019
self.token = token
2120
self.session = session
2221
self.stop_on_error = stop_on_error
@@ -26,7 +25,7 @@ def __init__(self, token:str, session=aiohttp.ClientSession(), stop_on_error:boo
2625
self.safe_search = ["off", "moderate", "strict"]
2726
self.valid_eyes = ["big", "black", "bloodshot", "blue", "default", "googly", "green", "horror", "illuminati", "money", "pink", "red", "small", "spinner", "spongebob", "white", "yellow", "random"]
2827

29-
async def _get_img(self, enpoint:str, body:dict) -> PxlObject:
28+
async def _get_img(self, enpoint: str, body: dict) -> PxlObject:
3029
"""
3130
The function making the request which gets image bytes in return. Not meant to be used outside of this class
3231

pypxl/pxl_object.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import io
22
from .errors import InvalidBytes
33

4-
class PxlObject():
4+
class PxlObject:
55
"""
66
An object you will get as a response to any request
77

0 commit comments

Comments
 (0)