Show More
@@ -12,7 +12,6 b' This contains aliases to hide python ver' | |||
|
12 | 12 | import builtins |
|
13 | 13 | import codecs |
|
14 | 14 | import concurrent.futures as futures |
|
15 | import functools | |
|
16 | 15 | import getopt |
|
17 | 16 | import http.client as httplib |
|
18 | 17 | import http.cookiejar as cookielib |
@@ -352,26 +351,11 b' def getdoc(obj: object) -> Optional[byte' | |||
|
352 | 351 | return sysbytes(doc) |
|
353 | 352 | |
|
354 | 353 | |
|
355 | def _wrapattrfunc(f): | |
|
356 | @functools.wraps(f) | |
|
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) | |
|
365 | return f(object, sysstr(name), *args) | |
|
366 | ||
|
367 | return w | |
|
368 | ||
|
369 | ||
|
370 | 354 | # these wrappers are automagically imported by hgloader |
|
371 |
delattr = |
|
|
372 |
getattr = |
|
|
373 |
hasattr = |
|
|
374 |
setattr = |
|
|
355 | delattr = builtins.delattr | |
|
356 | getattr = builtins.getattr | |
|
357 | hasattr = builtins.hasattr | |
|
358 | setattr = builtins.setattr | |
|
375 | 359 | xrange = builtins.range |
|
376 | 360 | unicode = str |
|
377 | 361 | |
@@ -386,7 +370,7 b' def open(' | |||
|
386 | 370 | return builtins.open(name, sysstr(mode), buffering, encoding) |
|
387 | 371 | |
|
388 | 372 | |
|
389 |
safehasattr = |
|
|
373 | safehasattr = builtins.hasattr | |
|
390 | 374 | |
|
391 | 375 | |
|
392 | 376 | def _getoptbwrapper( |
General Comments 0
You need to be logged in to leave comments.
Login now