Submit
Path:
~
/
/
opt
/
cloudlinux
/
venv
/
lib
/
python3.11
/
site-packages
/
libfuturize
/
fixes
/
File Content:
fix_unicode_keep_u.py
"""Fixer that changes unicode to str and unichr to chr, but -- unlike the lib2to3 fix_unicode.py fixer, does not change u"..." into "...". The reason is that Py3.3+ supports the u"..." string prefix, and, if present, the prefix may provide useful information for disambiguating between byte strings and unicode strings, which is often the hardest part of the porting task. """ from lib2to3.pgen2 import token from lib2to3 import fixer_base _mapping = {u"unichr" : u"chr", u"unicode" : u"str"} class FixUnicodeKeepU(fixer_base.BaseFix): BM_compatible = True PATTERN = "'unicode' | 'unichr'" def transform(self, node, results): if node.type == token.NAME: new = node.clone() new.value = _mapping[node.value] return new
Submit
FILE
FOLDER
Name
Size
Permission
Action
__pycache__
---
0755
__init__.py
5236 bytes
0644
fix_UserDict.py
3840 bytes
0644
fix_absolute_import.py
3140 bytes
0644
fix_add__future__imports_except_unicode_literals.py
662 bytes
0644
fix_basestring.py
394 bytes
0644
fix_bytes.py
685 bytes
0644
fix_cmp.py
701 bytes
0644
fix_division.py
228 bytes
0644
fix_division_safe.py
3631 bytes
0644
fix_execfile.py
921 bytes
0644
fix_future_builtins.py
2027 bytes
0644
fix_future_standard_library.py
733 bytes
0644
fix_future_standard_library_urllib.py
1001 bytes
0644
fix_input.py
687 bytes
0644
fix_metaclass.py
9568 bytes
0644
fix_next_call.py
3158 bytes
0644
fix_object.py
407 bytes
0644
fix_oldstr_wrap.py
1214 bytes
0644
fix_order___future__imports.py
829 bytes
0644
fix_print.py
3881 bytes
0644
fix_print_with_import.py
735 bytes
0644
fix_raise.py
3904 bytes
0644
fix_remove_old__future__imports.py
851 bytes
0644
fix_unicode_keep_u.py
779 bytes
0644
fix_unicode_literals_import.py
367 bytes
0644
fix_xrange_with_import.py
479 bytes
0644
N4ST4R_ID | Naxtarrr