Skip to content

Commit

Permalink
Fixed textual referenced bound methods issue on persistent job stores a…
Browse files Browse the repository at this point in the history
  • Loading branch information
spengjie committed Sep 30, 2020
1 parent b773c79 commit 51e6c44
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions apscheduler/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,9 @@ def __getstate__(self):

# Instance methods cannot survive serialization as-is, so store the "self" argument
# explicitly
if ismethod(self.func) and not isclass(self.func.__self__):
args = (self.func.__self__,) + tuple(self.args)
func = self.func
if ismethod(func) and not isclass(func.__self__) and not hasattr(func, '__func__'):
args = (func.__self__,) + tuple(self.args)
else:
args = self.args

Expand Down

0 comments on commit 51e6c44

Please sign in to comment.