51 """ |
51 """ |
52 codestring = codestring.replace("\r\n", "\n").replace("\r", "\n") |
52 codestring = codestring.replace("\r\n", "\n").replace("\r", "\n") |
53 |
53 |
54 if codestring and codestring[-1] != '\n': |
54 if codestring and codestring[-1] != '\n': |
55 codestring = codestring + '\n' |
55 codestring = codestring + '\n' |
56 |
|
57 # Check type for py2: if not str it's unicode |
|
58 # if sys.version_info[0] == 2: |
|
59 # try: |
|
60 # codestring = codestring.encode('utf-8') |
|
61 # except UnicodeError: |
|
62 # pass |
|
63 |
56 |
64 return codestring |
57 return codestring |
65 |
58 |
66 |
59 |
67 def jsSyntaxCheck(file, codestring): |
60 def jsSyntaxCheck(file, codestring): |