You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
>>> s._job
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/path/to/my/virtualenv/site-packages/schedule/__init__.py", line 284, in __repr__
args = [repr(x) if is_repr(x) else str(x) for x in self.job_func.args]
AttributeError: 'NoneType' object has no attribute 'args'
Line 284 (and similarly line 285 for kwargs) assumes self.job_func is not None (and has the "args" attribute). I think it needs to use logic similar to line 264 (and line 265, respectively for kwargs).
It may be helpful to extract line 264 to a reusable property:
@property
def _job_func_args(self):
return () if self.job_func is None else self.job_func.args
I can draft a PR if that would be helpful.
For context, I am using schedule as a schedule-builder interface, (i.e. just Job definitions without do).
The text was updated successfully, but these errors were encountered:
I've opened a PR with an alternative implementation of a fix. My approach is to fall back to the simpler .__str__() representation of the Job when it does not have the attributes needed to construct a pretty .__repr__() representation.
Line 284 (and similarly line 285 for kwargs) assumes self.job_func is not None (and has the "args" attribute). I think it needs to use logic similar to line 264 (and line 265, respectively for kwargs).
It may be helpful to extract line 264 to a reusable property:
I can draft a PR if that would be helpful.
For context, I am using
schedule
as a schedule-builder interface, (i.e. just Job definitions withoutdo
).The text was updated successfully, but these errors were encountered: