T
T
TanderOFF2021-07-13 17:54:32
Python
TanderOFF, 2021-07-13 17:54:32

How to skip the error?

for invite in invites_before_join:

            try:

                if invite.uses < find_invite_by_code(invites_after_join, invite.code).uses:

            except NameError as e:
                pass

                print('Не нашёл код')

Just
if invite.uses < find_invite_by_code(invites_after_join, invite.code).uses:
in some cases, the error NameError: name 'uses' is not defined

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Ronald McDonald, 2021-07-13
@Zoominger

Check uses for a value before using it.

A
Artem Imaev, 2021-07-14
@AIRC24

Can you catch all errors?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question