Teks sumber — English
Terjemahan — Bahasa Indonesia
If :data:`sys.stderr` is ``None``, nothing is printed. If :data:`sys.stderr` is not set, the exception is dumped to the C ``stderr`` stream instead.
Use :c:func:`PyErr_DisplayException` instead.
This is a convenience function to raise :exc:`OSError`. If called with *ierr* of ``0``, the error code returned by a call to :c:func:`!GetLastError` is used instead. It calls the Win32 function :c:func:`!FormatMessage` to retrieve the Windows description of error code given by *ierr* or :c:func:`!GetLastError`, then it constructs a :exc:`OSError` object with the :attr:`~OSError.winerror` attribute set to the error code, the :attr:`~OSError.strerror` attribute set to the corresponding error message (gotten from :c:func:`!FormatMessage`), and then calls ``PyErr_SetObject(PyExc_OSError, object)``. This function always returns ``NULL``.
Similar to :c:func:`PyErr_ProgramTextObject`, but *filename* is a :c:expr:`const char *`, which is decoded with the :term:`filesystem encoding and error handler`, instead of a Python object reference.
Do not compare the return value to a specific exception; use :c:func:`PyErr_ExceptionMatches` instead, shown below. (The comparison could easily fail since the exception may be an instance instead of a class, in the case of a class exception, or it may be a subclass of the expected exception.)
Use :c:func:`PyErr_GetRaisedException` instead.
Gunakan :c:func:`PyErr_GetRaisedException` sebagai gantinya.
Use :c:func:`PyErr_SetRaisedException` instead.
Gunakan :c:func:`PyErr_SetRaisedException` sebagai gantinya.
Use :c:func:`PyErr_GetRaisedException` instead, to avoid any possible de-normalization.
Gunakan :c:func:`PyErr_GetRaisedException` sebagai gantinya untuk menghindari segala kemungkinan denormalisasi.