Skip to content

Commit

Permalink
worker: remove Python 2 code from logger.py
Browse files Browse the repository at this point in the history
  • Loading branch information
lzaoral committed Mar 25, 2024
1 parent 9af6594 commit af73a03
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions kobo/worker/logger.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
# -*- coding: utf-8 -*-

import threading
import time
import os

import six

from six.moves import queue
from six import BytesIO
import queue
from io import BytesIO

import kobo.tback

Expand Down Expand Up @@ -40,7 +35,7 @@ def read_queue(self):
# We do not know whether we're being sent bytes or text.
# The hub API always wants bytes.
# Ensure we safely convert everything to bytes as we go.
if isinstance(out, six.text_type):
if isinstance(out, str):
out = out.encode('utf-8', errors='replace')

return out
Expand Down Expand Up @@ -103,7 +98,7 @@ def stop(self):
self.join()


class LoggingIO(object):
class LoggingIO():
"""StringIO wrapper that also writes all data to a logging thread."""

def __init__(self, io, logging_thread):
Expand Down

0 comments on commit af73a03

Please sign in to comment.