Fix time functions would throw errors in python scripts (#11414)
* Fix time functions would throw errors in python scripts * Added unit test for time.strptime, change variable name to satisfy lint * Added docstring for time attribute wrapper method to satisfy lint * Fixed line too long lint problem
This commit is contained in:
parent
5c2cecde70
commit
939d1b5ff6
2 changed files with 11 additions and 1 deletions
|
@ -202,4 +202,11 @@ class TimeWrapper:
|
|||
|
||||
def __getattr__(self, attr):
|
||||
"""Fetch an attribute from Time module."""
|
||||
return getattr(time, attr)
|
||||
attribute = getattr(time, attr)
|
||||
if callable(attribute):
|
||||
def wrapper(*args, **kw):
|
||||
"""Wrapper to return callable method if callable."""
|
||||
return attribute(*args, **kw)
|
||||
return wrapper
|
||||
else:
|
||||
return attribute
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue