@@ -30,9 +30,9 @@ def __init__(self, url, *args, **kwargs):
3030 url = self .get_link ("self" )
3131 if isinstance (url , list ): # Server has a list of links
3232 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 )
3434 self ._check_timeformat_lambda ()
35- super (BitbucketBase , self ).__init__ (url , * args , ** kwargs )
35+ super ().__init__ (url , * args , ** kwargs )
3636
3737 def __str__ (self ):
3838 return PrettyPrinter (indent = 4 ).pformat (self .__data if self .__data else self )
@@ -74,8 +74,7 @@ def _get_paged(
7474 if "values" not in response :
7575 return
7676
77- for value in response .get ("values" , []):
78- yield value
77+ yield from response .get ("values" , [])
7978
8079 if self .cloud :
8180 url = response .get ("next" )
@@ -165,9 +164,13 @@ def get_time(self, id):
165164 if sys .version_info <= (3 , 7 ):
166165 value_str = RE_TIMEZONE .sub (r"\1\2" , value_str )
167166 try :
167+ value_str = value_str [:26 ] + "Z"
168168 value = datetime .strptime (value_str , self .CONF_TIMEFORMAT )
169169 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+ )
171174 else :
172175 value = value_str
173176
@@ -192,10 +195,10 @@ def _new_session_args(self):
192195
193196 :return: A dict with the kwargs for new objects
194197 """
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