mahelbir / etempmail

Python module to get free disposable temporary email address
MIT License
3 stars 2 forks source link

TypeError: unsupported operand type(s) for |: 'type' and 'type' #1

Closed zxczxcdev closed 6 months ago

zxczxcdev commented 7 months ago
from etempmail import TempMail

# recovery: str = None, url: str = 'https://etempmail.com', debug_response: bool = True
temp_mail = TempMail()  # or TempMail('WHHKSIX7915')

print(temp_mail.domains())  # response -> (domain_id, domain_name)
# [('5', 'istanbultaksi.xyz'), ('4', 'privmail.com'), ('2', 'mailers.edu.pl')]
print(temp_mail.id)
# 7915
print(temp_mail.email)
# sidavm5dhc@istanbultaksi.xyz
print(temp_mail.recovery)
# WHHKSIX7915
print(temp_mail.inbox())
# [{'subject': 'test', 'from': 'Anonymousemail <noreply@gmail.com>', 'date': '16/08/2022 19:40:47', 'body': 'Test Body Code: 123'}]

temp_mail.recover('LHKXDMG7910')  # Recover email address
temp_mail.change()  # Change email address by random domain
temp_mail.change(4)  # Change email address by domain_id

and i have error :

Traceback (most recent call last):
  File "test.py", line 1, in <module>
    from etempmail import TempMail
  File "/home/tools.fteam.vn/.local/lib/python3.8/site-packages/etempmail/__init__.py", line 1, in <module>
    from etempmail.TempMail import TempMail
  File "/home/tools.fteam.vn/.local/lib/python3.8/site-packages/etempmail/TempMail.py", line 7, in <module>
    class TempMail:
  File "/home/tools.fteam.vn/.local/lib/python3.8/site-packages/etempmail/TempMail.py", line 73, in TempMail
    def change(self, domain_id: str | int = None):
TypeError: unsupported operand type(s) for |: 'type' and 'type'
mahelbir commented 6 months ago

|: 'type' was added in python 3.10, so not available in previous python versions.