X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=pdm%2Futil.py;h=53cc82a6043a3c910f80bf2167cc6f51236cd3b8;hb=9e3c83b113c519d0073457ae0cfe80291bcda7e9;hp=38b0ba059becdca72b95496d32294c729a7f1f4f;hpb=38fac1fb15e1d32173edbef33b07f8fc7799ae02;p=pdm.git diff --git a/pdm/util.py b/pdm/util.py index 38b0ba0..53cc82a 100644 --- a/pdm/util.py +++ b/pdm/util.py @@ -8,9 +8,9 @@ import sys, traceback, threading def threads(): "Returns a dict of currently known threads, mapped to their respective frames." - tt = {th.ident: th for th in threading.enumerate()} - return {tt.get(key, key): val for key, val in sys._current_frames().items()} + tt = dict((th.ident, th) for th in threading.enumerate()) + return dict((tt.get(key, key), val) for key, val in sys._current_frames().iteritems()) def traces(): "Returns the value of threads() with each frame expanded to a backtrace." - return {th: traceback.extract_stack(frame) for th, frame in threads().items()} + return dict((th, traceback.extract_stack(frame)) for th, frame in threads().iteritems())