svgui/pyjs/build.py
changeset 2459 21164625b393
parent 2451 6d1bf321fb89
--- a/svgui/pyjs/build.py	Fri Nov 23 11:01:20 2018 +0100
+++ b/svgui/pyjs/build.py	Fri Nov 23 12:13:24 2018 +0100
@@ -10,7 +10,7 @@
 from os.path import join, basename, abspath, split, isfile, isdir
 from hashlib import md5
 from optparse import OptionParser
-from cStringIO import StringIO
+from six.moves import cStringIO
 
 from svgui.pyjs import pyjs
 
@@ -45,7 +45,7 @@
 
 
 # .cache.html files produces look like this
-CACHE_HTML_PAT = re.compile('^[a-z]*.[0-9a-f]{32}\.cache\.html$')
+CACHE_HTML_PAT = re.compile(r'^[a-z]*.[0-9a-f]{32}\.cache\.html$')
 
 # ok these are the three "default" library directories, containing
 # the builtins (str, List, Dict, ord, round, len, range etc.)
@@ -184,7 +184,7 @@
         try:
             print("Creating output directory")
             os.mkdir(output)
-        except StandardError as e:
+        except OSError as e:
             print("Exception creating output directory %s: %s" % (output, e), file=sys.stderr)
 
     # public dir
@@ -254,7 +254,7 @@
 
     # the selector templ is added to the selectScript function
     select_tmpl = """O(["true","%s"],"%s");"""
-    script_selectors = StringIO()
+    script_selectors = cStringIO()
 
     for platform, file_prefix in app_files:
         print(select_tmpl % (platform, file_prefix), file=script_selectors)
@@ -453,7 +453,7 @@
             if dynamic:
                 mod_cache_html_output = open(join(output, mod_cache_name), "w")
             else:
-                mod_cache_html_output = StringIO()
+                mod_cache_html_output = cStringIO()
 
             print(mod_cache_html_template % dict(
                 mod_name=mod_name,