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/test86.in | |
parent | b6c589a529bc8c5720477494696c6f69fe457475 (diff) | |
download | vim-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.in | 49 |
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) |