Skip to content

Conversation

@lud4ik
Copy link
Contributor

@lud4ik lud4ik commented Dec 7, 2012

No description provided.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Мелочь, но эту строчку нужно вынести за try.
Потому что есть signa.signal вывалится с ошибкой то в finally возвращать старый обработчик не нужно (он и так стоит), да и не из чего (handler еще не присвоет и просто не существует).
Аналогично, например, нужно делать с блокировками без with:

l = RLock()
# ....
l.acquire()
try:
  do_something()
finally:
  l.release()

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Можешь написать это без eval?

asvetlov added a commit that referenced this pull request Dec 13, 2012
@asvetlov asvetlov merged commit 33d5b3e into learnpython:master Dec 13, 2012
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

Successfully merging this pull request may close these issues.

2 participants