Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_pokemon_species error with Gen 4+ Pokemon #51

Closed
Deleca7755 opened this issue Feb 23, 2023 · 1 comment
Closed

get_pokemon_species error with Gen 4+ Pokemon #51

Deleca7755 opened this issue Feb 23, 2023 · 1 comment

Comments

@Deleca7755
Copy link
Contributor

Describe the bug
Traceback (most recent call last):
File "C:\Users\Me Too\Desktop\Scripts\Python\Discord\pbtest.py", line 42, in
asyncio.run(main())
File "C:\Users\Me Too\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "C:\Users\Me Too\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Me Too\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\Users\Me Too\Desktop\Scripts\Python\Discord\pbtest.py", line 6, in main
await client.get_pokemon_species(425)
File "C:\Users\Me Too\Desktop\Scripts\Python\Discord\venv\Lib\site-packages\aiopoke\utils\cache.py", line 27, in wrapper
obj: U = await coro(client, name_or_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Me Too\Desktop\Scripts\Python\Discord\venv\Lib\site-packages\aiopoke\aiopoke_client.py", line 260, in get_pokemon_species
return PokemonSpecies(**data)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Me Too\Desktop\Scripts\Python\Discord\venv\Lib\site-packages\aiopoke\objects\resources\pokemon\pokemon_species.py", line 105, in __init__
self.habitat = MinimalResource(**habitat)
^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: aiopoke.utils.minimal_resources.MinimalResource() argument after ** must be a mapping, not NoneType

Process finished with exit code 1


Habitats were only In the Pokédex In Gen 3, so It's null on anything after that and thus trying to get the species won't work

To Reproduce
Do await client.get_pokemon_species(<name or id of Gen 4+ Pokemon>)

Expected behavior
Gets the species without being stopped by the lack of a habitat

Screenshots
image

Desktop (please complete the following information)

  • OS: Windows 10
  • Browser: Firefox
  • Version: 22H2 19045.2604 (OS) 110.0 (Browser)
@beastmatser
Copy link
Owner

This should be fixed. You can wait for v0.1.5 to be released, which should be in a few days, or you pull the code from github directly. Thank you for bringing up this bug!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants