Skip to content

Commit 0a7e549

Browse files
committed
Use python 3 semantics
1 parent 5f850cb commit 0a7e549

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

av/logging.pyx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ API Reference
3838
3939
"""
4040

41-
from __future__ import absolute_import
42-
4341
cimport libav as lib
4442
from libc.stdio cimport fprintf, stderr
4543
from libc.stdlib cimport free, malloc
@@ -223,7 +221,9 @@ cpdef log(int level, str name, str message):
223221
cdef log_context *obj = <log_context*>malloc(sizeof(log_context))
224222
obj.class_ = &log_class
225223
obj.name = name
226-
lib.av_log(<void*>obj, level, "%s", message)
224+
cdef bytes message_bytes = message.encode("utf-8")
225+
226+
lib.av_log(<void*>obj, level, "%s", <char*>message_bytes)
227227
free(obj)
228228

229229

setup.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,12 @@ def parse_cflags(raw_flags):
177177
library_dirs=extension_extra["library_dirs"],
178178
sources=[pyx_path],
179179
),
180-
compiler_directives=dict(
181-
c_string_type="str",
182-
c_string_encoding="ascii",
183-
embedsignature=True,
184-
language_level=2,
185-
),
180+
compiler_directives={
181+
"c_string_type": "str",
182+
"c_string_encoding": "ascii",
183+
"embedsignature": True,
184+
"language_level": 3,
185+
},
186186
build_dir="src",
187187
include_path=["include"],
188188
)

0 commit comments

Comments
 (0)