From e8e9a565526ac00b508da4717e9ae1f548083ae0 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 9 Feb 2014 13:19:29 -0500 Subject: More succinctly implement declare_state. --- pkg_resources.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'pkg_resources.py') diff --git a/pkg_resources.py b/pkg_resources.py index bde30989..73225e69 100644 --- a/pkg_resources.py +++ b/pkg_resources.py @@ -90,10 +90,8 @@ def _bypass_ensure_directory(name, mode=0x1FF): # 0777 _state_vars = {} def _declare_state(vartype, **kw): - g = globals() - for name, val in kw.items(): - g[name] = val - _state_vars[name] = vartype + globals().update(kw) + _state_vars.update(dict.from_keys(kw, vartype)) def __getstate__(): state = {} @@ -2339,6 +2337,8 @@ class Distribution(object): def insert_on(self, path, loc = None): """Insert self.location in path before its nearest parent directory""" + if 'foo' in path: + import pdb; pdb.set_trace() loc = loc or self.location if not loc: return -- cgit v1.2.1