Mercurial > public > mercurial-scm > hg
comparison mercurial/scmutil.py @ 31419:1fc3d1f02865
scmutil: make function name bytes in class filecache
func.__name__ returns unicodes and this leads to keyerror when we try
to do filecache[''] by passing bytes.
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Thu, 16 Mar 2017 06:32:33 +0530 |
parents | 719e64bf9ec2 |
children | 56acc4250900 |
comparison
equal
deleted
inserted
replaced
31418:fb1b5cd17664 | 31419:1fc3d1f02865 |
---|---|
883 """ | 883 """ |
884 raise NotImplementedError | 884 raise NotImplementedError |
885 | 885 |
886 def __call__(self, func): | 886 def __call__(self, func): |
887 self.func = func | 887 self.func = func |
888 self.name = func.__name__ | 888 self.name = func.__name__.encode('ascii') |
889 return self | 889 return self |
890 | 890 |
891 def __get__(self, obj, type=None): | 891 def __get__(self, obj, type=None): |
892 # if accessed on the class, return the descriptor itself. | 892 # if accessed on the class, return the descriptor itself. |
893 if obj is None: | 893 if obj is None: |