mercurial/pycompat.py
changeset 50924 9bffc6c4e4c5
parent 50176 829aa604d71a
child 51141 c845479fc64d
child 51310 f0e7d51bb454
equal deleted inserted replaced
50923:c642c03969ff 50924:9bffc6c4e4c5
   353 
   353 
   354 
   354 
   355 def _wrapattrfunc(f):
   355 def _wrapattrfunc(f):
   356     @functools.wraps(f)
   356     @functools.wraps(f)
   357     def w(object, name, *args):
   357     def w(object, name, *args):
       
   358         if isinstance(name, bytes):
       
   359             from . import util
       
   360 
       
   361             msg = b'function "%s" take `str` as argument, not `bytes`'
       
   362             fname = f.__name__.encode('ascii')
       
   363             msg %= fname
       
   364             util.nouideprecwarn(msg, b"6.6", stacklevel=2)
   358         return f(object, sysstr(name), *args)
   365         return f(object, sysstr(name), *args)
   359 
   366 
   360     return w
   367     return w
   361 
   368 
   362 
   369