# HG changeset patch # User Mike Miller # Date 1442710651 -7200 # Node ID f6fec9453ac97e86cf4541a580258b0c446ea807 # Parent 6552040d6d4c25d4bd37989d51ebc556f8937781 pytave.py: Second attempt to make pytave.py compatible diff -r 6552040d6d4c -r f6fec9453ac9 package/pytave.py --- 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