| Server IP : 103.48.194.25 / Your IP : 216.73.216.131 Web Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.33 System : Linux VMHostDefault 3.10.0-1160.42.2.el7.x86_64 #1 SMP Tue Sep 7 14:49:57 UTC 2021 x86_64 User : sieuthimay ( 1016) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /lib/python2.7/site-packages/libfuturize/fixes/ |
Upload File : |
"""
Fixer for adding:
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
This is "stage 1": hopefully uncontroversial changes.
Stage 2 adds ``unicode_literals``.
"""
from lib2to3 import fixer_base
from libfuturize.fixer_util import future_import
class FixAddFutureImportsExceptUnicodeLiterals(fixer_base.BaseFix):
BM_compatible = True
PATTERN = "file_input"
run_order = 9
def transform(self, node, results):
# Reverse order:
future_import(u"absolute_import", node)
future_import(u"division", node)
future_import(u"print_function", node)