mirror of
https://github.com/robweber/xbmcbackup.git
synced 2026-03-07 03:18:17 +01:00
part of #251 - modify previous strptime patch
This commit is contained in:
@@ -15,13 +15,9 @@ except ImportError:
|
||||
pass
|
||||
|
||||
# fix for datetime.strptime bug https://kodi.wiki/view/Python_Problems#datetime.strptime
|
||||
class proxydt(datetime.datetime):
|
||||
|
||||
@classmethod
|
||||
def strptime(cls, date_string, format):
|
||||
def patch_strptime(date_string, format):
|
||||
return datetime.datetime(*(time.strptime(date_string, format)[:6]))
|
||||
|
||||
datetime.datetime = proxydt
|
||||
|
||||
class QRCode(xbmcgui.WindowXMLDialog):
|
||||
def __init__(self, *args, **kwargs):
|
||||
@@ -154,7 +150,7 @@ class DropboxAuthorizer:
|
||||
if(token.strip() != ""):
|
||||
result = json.loads(token)
|
||||
# convert expiration back to a datetime object
|
||||
result['expiration'] = datetime.datetime.strptime(result['expiration'], "%Y-%m-%d %H:%M:%S.%f")
|
||||
result['expiration'] = patch_strptime(result['expiration'], "%Y-%m-%d %H:%M:%S.%f")
|
||||
|
||||
token_file.close()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user