Skip to content

Commit

Permalink
Fix QR code imports
Browse files Browse the repository at this point in the history
  • Loading branch information
jokelbaf committed Apr 18, 2024
1 parent b07daca commit bc44031
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions genshin/client/components/auth/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
import typing

import aiohttp
import qrcode
from qrcode import constants as qrcode_constants
from qrcode.image.pil import PilImage

from genshin import errors, types
from genshin.client import routes
Expand Down Expand Up @@ -189,11 +186,13 @@ async def login_with_app_password(
@base.region_specific(types.Region.CHINESE)
async def login_with_qrcode(self) -> QRLoginResult:
"""Login with QR code, only available for Miyoushe users."""
import qrcode
import qrcode.image.pil
from qrcode.constants import ERROR_CORRECT_L

creation_result = await self._create_qrcode()
qrc: PilImage = qrcode.make( # type: ignore
creation_result.url, error_correction=qrcode_constants.ERROR_CORRECT_L
)
qrc.show()
qrcode_: qrcode.image.pil.PilImage = qrcode.make(creation_result.url, error_correction=ERROR_CORRECT_L) # type: ignore
qrcode_.show()

scanned = False
while True:
Expand Down

0 comments on commit bc44031

Please sign in to comment.