equal
deleted
inserted
replaced
12 from .. import ( |
12 from .. import ( |
13 encoding, |
13 encoding, |
14 error, |
14 error, |
15 pycompat, |
15 pycompat, |
16 urllibcompat, |
16 urllibcompat, |
17 util, |
|
18 ) |
17 ) |
19 |
18 |
20 from . import ( |
19 from . import ( |
21 stringutil, |
20 stringutil, |
22 ) |
21 ) |
678 This decorator can be used to perform additional verification of |
677 This decorator can be used to perform additional verification of |
679 sub-options and to change the type of sub-options. |
678 sub-options and to change the type of sub-options. |
680 """ |
679 """ |
681 if isinstance(attr, bytes): |
680 if isinstance(attr, bytes): |
682 msg = b'pathsuboption take `str` as "attr" argument, not `bytes`' |
681 msg = b'pathsuboption take `str` as "attr" argument, not `bytes`' |
683 util.nouideprecwarn(msg, b"6.6", stacklevel=2) |
682 raise TypeError(msg) |
684 attr = attr.decode('ascii') |
|
685 |
683 |
686 def register(func): |
684 def register(func): |
687 _pathsuboptions[option] = (attr, func) |
685 _pathsuboptions[option] = (attr, func) |
688 path_suboptions_display[option] = display |
686 path_suboptions_display[option] = display |
689 return func |
687 return func |