SF patch 419176 from MvL; fixed bug 418977

Two errors in dict_to_map() helper used by PyFrame_LocalsToFast().
diff --git a/Lib/test/test_scope.py b/Lib/test/test_scope.py
index c42d881..fb53790 100644
--- a/Lib/test/test_scope.py
+++ b/Lib/test/test_scope.py
@@ -447,3 +447,23 @@
 
 inst = f(3)()
 verify(inst.a == inst.m())
+
+print "20. interaction with trace function"
+
+import sys
+def tracer(a,b,c):
+    return tracer
+
+def adaptgetter(name, klass, getter):
+    kind, des = getter
+    if kind == 1:       # AV happens when stepping from this line to next
+        if des == "":
+            des = "_%s__%s" % (klass.__name__, name)
+        return lambda obj: getattr(obj, des)
+
+class TestClass:
+    pass
+
+sys.settrace(tracer)
+adaptgetter("foo", TestClass, (1, ""))
+sys.settrace(None)