@@ -30,9 +30,9 @@ def __init__(self, url, *args, **kwargs):
30
30
url = self .get_link ("self" )
31
31
if isinstance (url , list ): # Server has a list of links
32
32
url = url [0 ]
33
- self .timeformat_lambda = kwargs .pop ("timeformat_lambda" , lambda x : self ._default_timeformat_lambda ( x ) )
33
+ self .timeformat_lambda = kwargs .pop ("timeformat_lambda" , self ._default_timeformat_lambda )
34
34
self ._check_timeformat_lambda ()
35
- super (BitbucketBase , self ).__init__ (url , * args , ** kwargs )
35
+ super ().__init__ (url , * args , ** kwargs )
36
36
37
37
def __str__ (self ):
38
38
return PrettyPrinter (indent = 4 ).pformat (self .__data if self .__data else self )
@@ -74,8 +74,7 @@ def _get_paged(
74
74
if "values" not in response :
75
75
return
76
76
77
- for value in response .get ("values" , []):
78
- yield value
77
+ yield from response .get ("values" , [])
79
78
80
79
if self .cloud :
81
80
url = response .get ("next" )
@@ -165,9 +164,13 @@ def get_time(self, id):
165
164
if sys .version_info <= (3 , 7 ):
166
165
value_str = RE_TIMEZONE .sub (r"\1\2" , value_str )
167
166
try :
167
+ value_str = value_str [:26 ] + "Z"
168
168
value = datetime .strptime (value_str , self .CONF_TIMEFORMAT )
169
169
except ValueError :
170
- value = datetime .strptime (value_str , "%Y-%m-%dT%H:%M:%S.%fZ" , tzinfo = "UTC" )
170
+ value = datetime .strptime (
171
+ value_str ,
172
+ "%Y-%m-%dT%H:%M:%S.%fZ" ,
173
+ )
171
174
else :
172
175
value = value_str
173
176
@@ -192,10 +195,10 @@ def _new_session_args(self):
192
195
193
196
:return: A dict with the kwargs for new objects
194
197
"""
195
- return dict (
196
- session = self ._session ,
197
- cloud = self .cloud ,
198
- api_root = self .api_root ,
199
- api_version = self .api_version ,
200
- timeformat_lambda = self .timeformat_lambda ,
201
- )
198
+ return {
199
+ " session" : self ._session ,
200
+ " cloud" : self .cloud ,
201
+ " api_root" : self .api_root ,
202
+ " api_version" : self .api_version ,
203
+ " timeformat_lambda" : self .timeformat_lambda ,
204
+ }
0 commit comments