Finish bringing SVN into line with latest version of PEP 343 by getting rid of all remaining references to context objects that I could find. Without a __context__() method context objects no longer exist. Also get test_with working again, and adopt a suggestion from Neal for decimal.Context.get_manager()
diff --git a/Lib/decimal.py b/Lib/decimal.py
index 2f989a8..2e0afff 100644
--- a/Lib/decimal.py
+++ b/Lib/decimal.py
@@ -2173,7 +2173,7 @@
del name, val, globalname, rounding_functions
-class WithStatementContext(object):
+class ContextManager(object):
"""Helper class to simplify Context management.
Sample usage:
@@ -2248,8 +2248,8 @@
s.append('traps=[' + ', '.join([t.__name__ for t, v in self.traps.items() if v]) + ']')
return ', '.join(s) + ')'
- def context_manager(self):
- return WithStatementContext(self.copy())
+ def get_manager(self):
+ return ContextManager(self.copy())
def clear_flags(self):
"""Reset all flags to zero"""