From 4d0a286e854cfcd0295a2633615c1c5ff4eb17b5 Mon Sep 17 00:00:00 2001 From: Marcell Pardavi Date: Tue, 25 Mar 2025 14:18:29 +0100 Subject: [PATCH] Use Python 3 compatible stderr logging in Cython --- av/error.pyx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/av/error.pyx b/av/error.pyx index b8b415207..c3d8a3e7b 100644 --- a/av/error.pyx +++ b/av/error.pyx @@ -1,4 +1,5 @@ cimport libav as lib +from libc.stdio cimport fprintf, stderr from libc.stdlib cimport free, malloc from av.logging cimport get_last_error @@ -367,7 +368,7 @@ cdef int stash_exception(exc_info=None): existing = getattr(_local, "exc_info", None) if existing is not None: - print >> sys.stderr, "PyAV library exception being dropped:" + fprintf(stderr, "PyAV library exception being dropped:\n") traceback.print_exception(*existing) _err_count -= 1 # Balance out the +=1 that is coming.