Skip to content

Commit

Permalink
fix: Use ABC instead of ABCMeta for raising exceptions in python2/3
Browse files Browse the repository at this point in the history
  • Loading branch information
ar13pit committed Jun 17, 2020
1 parent 12c8374 commit ddca995
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/python/yapykaldi/asr/_base.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"""Base classes for the ASR pipeline"""
from __future__ import print_function, division, absolute_import, unicode_literals
from builtins import *
from abc import ABCMeta, abstractmethod
from abc import ABC, abstractmethod
from threading import Event
import pyaudio


class AsrPipelineElementBase(object):
class AsrPipelineElementBase(ABC):
"""Class AsrPipelineElementBase is the base class for all Asr Pipeline elements.
It requires three abstract methods to be implemented:
Expand All @@ -26,9 +26,7 @@ class AsrPipelineElementBase(object):
start, next_chunk, stop several times
"""
# pylint: disable=useless-object-inheritance

__metaclass__ = ABCMeta
# pylint: disable=too-many-instance-attributes

def __init__(self, source=None, sink=None, rate=16000, chunksize=1024, fmt=pyaudio.paInt16, channels=1, timeout=1):
self._source = None
Expand Down

0 comments on commit ddca995

Please sign in to comment.