Skip to content

Commit

Permalink
Minor fix and added dependency on six
Browse files Browse the repository at this point in the history
Fixes to make it work on python2.7 again.
Dependency for package six.
  • Loading branch information
janjaapbos committed May 28, 2014
1 parent 1168b83 commit 05c64a1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyjs/linker.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def __call__(self):
self.visit_end_platform(platform)
if not self.list_imports:
self.visit_end()
except translator.TranslationError( e ):
except translator.TranslationError, e:
raise

def visit_modules(self, module_names, platform=None, parent_file = None):
Expand Down
6 changes: 3 additions & 3 deletions pyjs/translator_proto.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import types
import os
import copy
from six.moves import cStringIO
from six.moves import cStringIO as StringIO
import re
try:
from hashlib import md5
Expand Down Expand Up @@ -2131,7 +2131,7 @@ def _from(self, node, current_klass, root_level = False):
self.add_lookup("__pyjamas__", ass_name, name[0])
else:
self.add_lookup("__pyjamas__", ass_name, jsname)
except AttributeError(e):
except AttributeError, e:
#raise TranslationError("Unknown __pyjamas__ import: %s" % name, node)
pass
return
Expand Down Expand Up @@ -3955,7 +3955,7 @@ def _mul(self, node, current_klass):
%(s)s\t@{{op_mul}}(%(v1)s,%(v2)s))""" % locals()

def _mod(self, node, current_klass):
if isinstance(node.left, self.ast.Const) and isinstance(node.left.value, StringType):
if isinstance(node.left, self.ast.Const) and isinstance(node.left.value, types.StringType):
return self.track_call("@{{sprintf}}("+self.expr(node.left, current_klass) + ", " + self.expr(node.right, current_klass)+")", node.lineno)

e1 = self.expr(node.left, current_klass)
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ def read(fname):
package_data=package_data,
zip_safe = False,
entry_points = entry_points,

install_requires=['six'],

license="Apache",
keywords=["js", "javascript"],
url = "http://pyjs.org",
Expand Down

0 comments on commit 05c64a1

Please sign in to comment.