Mercurial > pytave
changeset 114:f6fec9453ac9
pytave.py: Second attempt to make pytave.py compatible
author | Mike Miller <mtmiller@octave.org> |
---|---|
date | Sun, 20 Sep 2015 02:57:31 +0200 |
parents | 6552040d6d4c |
children | 00d19f71c9ca |
files | package/pytave.py |
diffstat | 1 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/package/pytave.py Sun Sep 20 02:41:36 2015 +0200 +++ b/package/pytave.py Sun Sep 20 02:57:31 2015 +0200 @@ -23,7 +23,11 @@ import _pytave import atexit import sys -import collections + +try: + from collections.abc import MutableMapping +except: + from UserDict import DictMixin as MutableMapping arg0 = sys.argv[0] # Some web application packages, such as mod_wsgi for Apache, @@ -244,7 +248,7 @@ """Equivalent to pkg unload. See Octave documentation.""" return _pytave.feval(0, "pkg", ("unload", pkg_name)) -class _VariablesDict(collections.MutableMapping): +class _VariablesDict(MutableMapping): def __init__(self, global_variables, native=False): self.global_variables = global_variables self.native = native