InterruptedError

In Python, InterruptedError is a built-in exception that occurs when a system call is interrupted by an external signal.

This exception typically appears in multithreaded programs or when dealing with asynchronous operations. When a signal is received, the system call is interrupted, and InterruptedError is raised to indicate this interruption.

InterruptedError Occurs When

Performing system call in multithreaded programs.

InterruptedError Can Be Used When

  • Managing signals in asynchronous operations
  • Implementing robust error handling in applications that rely on system calls

Tutorial

An Intro to Threading in Python

In this intermediate-level tutorial, you'll learn how to use threading in your Python programs. You'll see how to create threads, how to coordinate and synchronize them, and how to handle common problems that arise in threading.

intermediate best-practices

For additional information on related topics, take a look at the following resources:


By Leodanis Pozo Ramos • Updated May 20, 2025