1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
diff --git a/Tools/pymolcas/emil_grammar.py b/Tools/pymolcas/emil_grammar.py
index acbbae8..509c56f 100644
--- a/Tools/pymolcas/emil_grammar.py
+++ b/Tools/pymolcas/emil_grammar.py
@@ -15,6 +15,14 @@
from __future__ import (unicode_literals, division, absolute_import, print_function)
+try:
+ u = unicode
+ del u
+ py2 = True
+except NameError:
+ pass
+
+
from re import sub
from pyparsing import *
@@ -24,6 +32,8 @@ def chomp(s):
def chompAction(s, l, t):
try:
+ if (py2):
+ pass
return list(map(lambda s: chomp(unicode(s)), t))
except NameError:
return list(map(chomp, t))
@@ -33,6 +43,8 @@ def removeEMILEnd(s):
def removeEMILEndAction(s, l, t):
try:
+ if (py2):
+ pass
return list(map(lambda s: removeEMILEnd(unicode(s)), t))
except NameError:
return list(map(removeEMILEnd, t))
|