summaryrefslogtreecommitdiff
path: root/lib/git_python
diff options
context:
space:
mode:
authorDavid Aguilar <davvid@gmail.com>2008-05-29 01:50:55 -0700
committerDavid Aguilar <davvid@gmail.com>2008-05-29 01:50:55 -0700
commit8501e908bb8c531dfa75cef33fcec519027f4e5b (patch)
tree05983d2952787cf220e7b5cce47b738fbfedf438 /lib/git_python
parenta7129dc00826cb344c0202f152f1be33ea9326fe (diff)
downloadgitpython-8501e908bb8c531dfa75cef33fcec519027f4e5b.tar.gz
utils: add a pop_key helper function
pop_key removes a value from a dictionary and it in one step. This function will be used in the next integration. Signed-off-by: David Aguilar <davvid@gmail.com>
Diffstat (limited to 'lib/git_python')
-rw-r--r--lib/git_python/utils.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/git_python/utils.py b/lib/git_python/utils.py
index c2140ba0..f367c3e2 100644
--- a/lib/git_python/utils.py
+++ b/lib/git_python/utils.py
@@ -3,3 +3,9 @@ def dashify(string):
def touch(filename):
open(filename, "a").close()
+
+def pop_key(d, key):
+ value = d.get(key, None)
+ if key in d:
+ del d[key]
+ return value