comparison mercurial/templater.py @ 35588:dadbf213a765

py3: convert dict keys' to str before passing as kwargs We have pycompat.strkwargs() which converts the keys of a dict to str and returns that. Differential Revision: https://phab.mercurial-scm.org/D1798
author Pulkit Goyal <7895pulkit@gmail.com>
date Fri, 29 Dec 2017 05:31:27 +0530
parents 964510dcdc2a
children 077ee15b8493
comparison
equal deleted inserted replaced
35587:f2f0a777b2e2 35588:dadbf213a765
395 if callable(v): 395 if callable(v):
396 # TODO: templatekw functions will be updated to take (context, mapping) 396 # TODO: templatekw functions will be updated to take (context, mapping)
397 # pair instead of **props 397 # pair instead of **props
398 props = context._resources.copy() 398 props = context._resources.copy()
399 props.update(mapping) 399 props.update(mapping)
400 return v(**props) 400 return v(**pycompat.strkwargs(props))
401 return v 401 return v
402 402
403 def buildtemplate(exp, context): 403 def buildtemplate(exp, context):
404 ctmpl = [compileexp(e, context, methods) for e in exp[1:]] 404 ctmpl = [compileexp(e, context, methods) for e in exp[1:]]
405 return (runtemplate, ctmpl) 405 return (runtemplate, ctmpl)