Skip to content

Commit 445c7c6

Browse files
chkoarGuillaume Lemaitre
authored andcommitted
Prevent logger from being pickled
1 parent 642a5d4 commit 445c7c6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

imblearn/base.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,3 +225,9 @@ def _sample(self, X, y):
225225
The corresponding label of `X_resampled`
226226
"""
227227
pass
228+
229+
def __getstate__(self):
230+
"""Prevent logger from being pickled"""
231+
object_dictionary = dict(self.__dict__)
232+
del object_dictionary['logger']
233+
return object_dictionary

0 commit comments

Comments
 (0)