##// END OF EJS Templates
typing: disable a bogus attribute-error warning in phabricator...
Matt Harbison -
r50758:92743e6d default
parent child Browse files
Show More
@@ -353,11 +353,14 b' def urlencodenested(params):'
353 """
353 """
354 flatparams = util.sortdict()
354 flatparams = util.sortdict()
355
355
356 def process(prefix, obj):
356 def process(prefix: bytes, obj):
357 if isinstance(obj, bool):
357 if isinstance(obj, bool):
358 obj = {True: b'true', False: b'false'}[obj] # Python -> PHP form
358 obj = {True: b'true', False: b'false'}[obj] # Python -> PHP form
359 lister = lambda l: [(b'%d' % k, v) for k, v in enumerate(l)]
359 lister = lambda l: [(b'%d' % k, v) for k, v in enumerate(l)]
360 # .items() will only be called for a dict type
361 # pytype: disable=attribute-error
360 items = {list: lister, dict: lambda x: x.items()}.get(type(obj))
362 items = {list: lister, dict: lambda x: x.items()}.get(type(obj))
363 # pytype: enable=attribute-error
361 if items is None:
364 if items is None:
362 flatparams[prefix] = obj
365 flatparams[prefix] = obj
363 else:
366 else:
General Comments 0
You need to be logged in to leave comments. Login now