summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-09-12 13:10:59 +0000
committerZac Medico <zmedico@gentoo.org>2009-09-12 13:10:59 +0000
commit7a9607ad10fff8fcfdfeb67da8bf9b60a36feb13 (patch)
tree546b371e1cfa9a49bc5912b24b19fb38ae5422f6
parenta399b35ab64bae798a53536ac97f174d3020d3f3 (diff)
downloadportage-7a9607ad10fff8fcfdfeb67da8bf9b60a36feb13.tar.gz
portage-7a9607ad10fff8fcfdfeb67da8bf9b60a36feb13.tar.bz2
portage-7a9607ad10fff8fcfdfeb67da8bf9b60a36feb13.zip
Implement Atom.__copy__ and __deepcopy__ to return self, since instances are
immutable. svn path=/main/trunk/; revision=14223
-rw-r--r--pym/portage/dep.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/pym/portage/dep.py b/pym/portage/dep.py
index df082eb70..cf06eca7f 100644
--- a/pym/portage/dep.py
+++ b/pym/portage/dep.py
@@ -657,6 +657,15 @@ class Atom(object):
def rstrip(self, *pargs, **kargs):
return self._str.rstrip(*pargs, **kargs)
+ def __copy__(self):
+ """Immutable, so returns self."""
+ return self
+
+ def __deepcopy__(self, memo=None):
+ """Immutable, so returns self."""
+ memo[id(self)] = self
+ return self
+
def get_operator(mydep):
"""
Return the operator used in a depstring.