comparison hgext/win32mbcs.py @ 30476:8a9681b963a3

win32mbcs: drop code that was catering to Python 2.3 and earlier
author Augie Fackler <augie@google.com>
date Mon, 21 Nov 2016 17:48:13 -0500
parents 6f447b9ec263
children 6f9fcd29e290
comparison
equal deleted inserted replaced
30475:ef9f197188ec 30476:8a9681b963a3
136 module, name = name.rsplit('.', 1) 136 module, name = name.rsplit('.', 1)
137 module = sys.modules[module] 137 module = sys.modules[module]
138 func = getattr(module, name) 138 func = getattr(module, name)
139 def f(*args, **kwds): 139 def f(*args, **kwds):
140 return wrapper(func, args, kwds) 140 return wrapper(func, args, kwds)
141 try: 141 f.__name__ = func.__name__
142 f.__name__ = func.__name__ # fails with Python 2.3
143 except Exception:
144 pass
145 setattr(module, name, f) 142 setattr(module, name, f)
146 143
147 # List of functions to be wrapped. 144 # List of functions to be wrapped.
148 # NOTE: os.path.dirname() and os.path.basename() are safe because 145 # NOTE: os.path.dirname() and os.path.basename() are safe because
149 # they use result of os.path.split() 146 # they use result of os.path.split()