Skip to content

Commit 454e89f

Browse files
authored
🐛fix argument validation bug
The info endpoint data was not being dealt with correctly, causing errors whenever it was used. This is now fixed.
1 parent f10966c commit 454e89f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

main.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ class Jokes:
88
def __init__(self):
99
self.http = urllib3.PoolManager()
1010
self.info = self.http.request('GET', "https://sv443.net/jokeapi/v2/info")
11+
self.info = data = json.loads(self.info.data.decode('utf-8'))["jokes"]
12+
print(self.info)
1113
print("Sv443's JokeAPI")
1214

1315
def build_request(

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
setuptools.setup(
77
name="jokeapi",
88
packages=["jokeapi"],
9-
version="0.2.4",
9+
version="0.2.5",
1010
license="GNU General Public License v3 (GPLv3)",
1111
description="An API Wrapper for Sv443's JokeAPI",
1212
long_description=long_description,
1313
long_description_content_type="text/markdown",
1414
author="thenamesweretakenalready",
1515
author_email="[email protected]",
1616
url="""https://github.com/thenamesweretakenalready/Sv443s-JokeAPI-Python-Wrapper""",
17-
download_url="https://github.com/thenamesweretakenalready/Sv443s-JokeAPI-Python-Wrapper/archive/v0.2.4.tar.gz",
17+
download_url="https://github.com/thenamesweretakenalready/Sv443s-JokeAPI-Python-Wrapper/archive/v0.2.5.tar.gz",
1818
keywords=["api wrapper", "wrapper", "api", "jokes", "python", "joke api"],
1919
install_requires=[
2020
"urllib3==1.25.8",

0 commit comments

Comments
 (0)