summaryrefslogtreecommitdiff
path: root/src/testdir/test86.in
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2013-05-15 14:51:35 +0200
committerBram Moolenaar <Bram@vim.org>2013-05-15 14:51:35 +0200
commit03db85b398746a252345ed8a7da69f0f2591e932 (patch)
tree7ed0344aa301a35ff620990e64264250182e06fd /src/testdir/test86.in
parentb6c589a529bc8c5720477494696c6f69fe457475 (diff)
downloadvim-git-03db85b398746a252345ed8a7da69f0f2591e932.tar.gz
updated for version 7.3.948v7.3.948
Problem: Cannot build with Python 2.2 Solution: Make Python interface work with Python 2.2 Make 2.2 the first supported version. (ZyX)
Diffstat (limited to 'src/testdir/test86.in')
-rw-r--r--src/testdir/test86.in49
1 files changed, 16 insertions, 33 deletions
diff --git a/src/testdir/test86.in b/src/testdir/test86.in
index 5b87633a7..8ef7e057f 100644
--- a/src/testdir/test86.in
+++ b/src/testdir/test86.in
@@ -183,38 +183,21 @@ STARTTEST
: $put ='[0.0, 0.0]'
:endif
:let messages=[]
-:py <<EOF
+py <<EOF
d=vim.bindeval('{}')
m=vim.bindeval('messages')
-try:
- d['abc']
-except Exception as e:
- m.extend([e.__class__.__name__])
-
-try:
- d['abc']="\0"
-except Exception as e:
- m.extend([e.__class__.__name__])
-
-try:
- d['abc']=vim
-except Exception as e:
- m.extend([e.__class__.__name__])
-
-try:
- d['']=1
-except Exception as e:
- m.extend([e.__class__.__name__])
-
-try:
- d['a\0b']=1
-except Exception as e:
- m.extend([e.__class__.__name__])
+def em(expr, g=globals(), l=locals()):
+ try:
+ exec(expr, g, l)
+ except:
+ m.extend([sys.exc_type.__name__])
-try:
- d[b'a\0b']=1
-except Exception as e:
- m.extend([e.__class__.__name__])
+em('d["abc"]')
+em('d["abc"]="\\0"')
+em('d["abc"]=vim')
+em('d[""]=1')
+em('d["a\\0b"]=1')
+em('d[u"a\\0b"]=1')
EOF
:$put =messages
:unlet messages
@@ -394,14 +377,14 @@ py << EOF
def e(s, g=globals(), l=locals()):
try:
exec(s, g, l)
- except Exception as e:
- vim.command('throw ' + repr(e.__class__.__name__))
+ except:
+ vim.command('throw ' + repr(sys.exc_type.__name__))
def ev(s, g=globals(), l=locals()):
try:
return eval(s, g, l)
- except Exception as e:
- vim.command('throw ' + repr(e.__class__.__name__))
+ except:
+ vim.command('throw ' + repr(sys.exc_type.__name__))
return 0
EOF
:function E(s)