svgui/pyjs/pyjs.py
changeset 2431 6923074540dd
parent 2415 f7d8891fe708
child 2434 07f48018b6f5
--- a/svgui/pyjs/pyjs.py	Wed Oct 03 15:47:59 2018 +0300
+++ b/svgui/pyjs/pyjs.py	Thu Oct 04 11:25:42 2018 +0300
@@ -13,7 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
-# pylint: disable=no-absolute-import
+# pylint: disable=no-absolute-import,bad-python3-import
 
 from __future__ import print_function
 import sys
@@ -22,7 +22,7 @@
 from compiler import ast
 import os
 import copy
-import cStringIO
+from six.moves import cStringIO
 
 # the standard location for builtins (e.g. pyjslib) can be
 # over-ridden by changing this.  it defaults to sys.prefix
@@ -1443,7 +1443,7 @@
             raise TranslationError("varargs are not supported in Lambdas", node)
         if node.kwargs:
             raise TranslationError("kwargs are not supported in Lambdas", node)
-        res = cStringIO.StringIO()
+        res = cStringIO()
         arg_names = list(node.argnames)
         function_args = ", ".join(arg_names)
         for child in node.getChildNodes():
@@ -1534,7 +1534,7 @@
     f = file(file_name, "r")
     src = f.read()
     f.close()
-    output = cStringIO.StringIO()
+    output = cStringIO()
     mod = compiler.parseFile(file_name)
     Translator(module_name, module_name, module_name, src, debug, mod, output)
     return output.getvalue()
@@ -1683,7 +1683,7 @@
 
         file_name = self.findFile(module_name + self.extension)
 
-        output = cStringIO.StringIO()
+        output = cStringIO()
 
         f = file(file_name, "r")
         src = f.read()
@@ -1718,8 +1718,8 @@
 
     def translate(self, module_name, is_app=True, debug=False,
                   library_modules=None):
-        app_code = cStringIO.StringIO()
-        lib_code = cStringIO.StringIO()
+        app_code = cStringIO()
+        lib_code = cStringIO()
         imported_js = set()
         self.library_modules = []
         self.overrides = {}