##// END OF EJS Templates
py3: source-transform only call-sites of iteritems(), not definitions...
Martin von Zweigbergk -
r42809:3018749a default
parent child Browse files
Show More
@@ -167,6 +167,8 b' class lazyremotenamedict(mutablemapping)'
167 167 for k, vtup in self.potentialentries.iteritems():
168 168 yield (k, [bin(vtup[0])])
169 169
170 items = iteritems
171
170 172 class remotenames(object):
171 173 """
172 174 This class encapsulates all the remotenames state. It also contains
@@ -225,7 +225,9 b' if sys.version_info[0] >= 3:'
225 225
226 226 # It changes iteritems/values to items/values as they are not
227 227 # present in Python 3 world.
228 elif fn in ('iteritems', 'itervalues'):
228 elif (fn in ('iteritems', 'itervalues') and
229 not (tokens[i - 1].type == token.NAME and
230 tokens[i - 1].string == 'def')):
229 231 yield t._replace(string=fn[4:])
230 232 continue
231 233
@@ -236,7 +238,7 b' if sys.version_info[0] >= 3:'
236 238 # ``replacetoken`` or any mechanism that changes semantics of module
237 239 # loading is changed. Otherwise cached bytecode may get loaded without
238 240 # the new transformation mechanisms applied.
239 BYTECODEHEADER = b'HG\x00\x0b'
241 BYTECODEHEADER = b'HG\x00\x0c'
240 242
241 243 class hgloader(importlib.machinery.SourceFileLoader):
242 244 """Custom module loader that transforms source code.
@@ -218,6 +218,8 b' class branchcache(object):'
218 218 self._verifybranch(k)
219 219 yield k, v
220 220
221 items = iteritems
222
221 223 def hasbranch(self, label):
222 224 """ checks whether a branch of this name exists or not """
223 225 self._verifybranch(label)
General Comments 0
You need to be logged in to leave comments. Login now