diff options
author | Bram Moolenaar <Bram@vim.org> | 2013-05-15 14:51:35 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2013-05-15 14:51:35 +0200 |
commit | 03db85b398746a252345ed8a7da69f0f2591e932 (patch) | |
tree | 7ed0344aa301a35ff620990e64264250182e06fd /src/testdir | |
parent | b6c589a529bc8c5720477494696c6f69fe457475 (diff) | |
download | vim-03db85b398746a252345ed8a7da69f0f2591e932.zip |
updated for version 7.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')
-rw-r--r-- | src/testdir/test86.in | 49 | ||||
-rw-r--r-- | src/testdir/test86.ok | 3 | ||||
-rw-r--r-- | src/testdir/test87.ok | 3 |
3 files changed, 16 insertions, 39 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) diff --git a/src/testdir/test86.ok b/src/testdir/test86.ok index 4b54d985f..481acae7d 100644 --- a/src/testdir/test86.ok +++ b/src/testdir/test86.ok @@ -82,7 +82,6 @@ def bar >>> paste p/gopts1: False - inv: 2! ValueError p/wopts1! KeyError inv: 2! KeyError wopts1! KeyError @@ -224,7 +223,6 @@ bar wopts2! KeyError wopts3! KeyError p/bopts1: False - inv: 2! ValueError G: 0 W: 1:0 2:1 3:0 4:1 B: 1:0 2:1 3:0 4:1 @@ -280,7 +278,6 @@ bar wopts2! KeyError wopts3! KeyError p/bopts1: False - inv: 2! ValueError G: 0 W: 1:0 2:1 3:0 4:1 B: 1:0 2:1 3:0 4:1 diff --git a/src/testdir/test87.ok b/src/testdir/test87.ok index e7d031bfb..3addec8b3 100644 --- a/src/testdir/test87.ok +++ b/src/testdir/test87.ok @@ -71,7 +71,6 @@ def bar >>> paste p/gopts1: False - inv: 2! ValueError p/wopts1! KeyError inv: 2! KeyError wopts1! KeyError @@ -213,7 +212,6 @@ bar wopts2! KeyError wopts3! KeyError p/bopts1: False - inv: 2! ValueError G: 0 W: 1:0 2:1 3:0 4:1 B: 1:0 2:1 3:0 4:1 @@ -269,7 +267,6 @@ bar wopts2! KeyError wopts3! KeyError p/bopts1: False - inv: 2! ValueError G: 0 W: 1:0 2:1 3:0 4:1 B: 1:0 2:1 3:0 4:1 |