From a7d9bdcb241366fb45fc672575200781856f9341 Mon Sep 17 00:00:00 2001 From: jenssss <37403847+jenssss@users.noreply.github.com> Date: Sun, 21 Mar 2021 21:09:48 +0900 Subject: [PATCH] Fixing AttributeError Calling AudioFile(audio_dir) where audio_dir is a AudioDirectory object was causing an AttributeError, since the audio_file variable was being replaced by a string, before the labels_file variable was read out from it. --- micmon/audio/file.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/micmon/audio/file.py b/micmon/audio/file.py index a314210..368fa30 100644 --- a/micmon/audio/file.py +++ b/micmon/audio/file.py @@ -15,8 +15,8 @@ def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) if isinstance(audio_file, AudioDirectory): - audio_file = audio_file.audio_file labels_file = audio_file.labels_file + audio_file = audio_file.audio_file self.audio_file = os.path.abspath(os.path.expanduser(audio_file))