diff options
author | Alec Warner <antarus@gentoo.org> | 2007-01-11 21:38:32 +0000 |
---|---|---|
committer | Alec Warner <antarus@gentoo.org> | 2007-01-11 21:38:32 +0000 |
commit | 28ae3c3314f3df05116df51c76df4150f913aceb (patch) | |
tree | dce625a09574b2ab3c858931f3a2a4dfbbd5ce7c /pym/portage_versions.py | |
parent | da67328341fef2cc4d9e85be0694aad113b30c0a (diff) | |
download | portage-28ae3c3314f3df05116df51c76df4150f913aceb.tar.gz portage-28ae3c3314f3df05116df51c76df4150f913aceb.tar.bz2 portage-28ae3c3314f3df05116df51c76df4150f913aceb.zip |
Handle the exception in isvalidatom, change it to use a portage exceptoin, thanks to Zac for pointing this out
svn path=/main/trunk/; revision=5571
Diffstat (limited to 'pym/portage_versions.py')
-rw-r--r-- | pym/portage_versions.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/pym/portage_versions.py b/pym/portage_versions.py index 706c197fd..b4bbb5700 100644 --- a/pym/portage_versions.py +++ b/pym/portage_versions.py @@ -10,6 +10,7 @@ suffix_regexp = re.compile("^(alpha|beta|rc|pre|p)(\\d*)$") suffix_value = {"pre": -2, "p": 0, "alpha": -4, "beta": -3, "rc": -1} endversion_keys = ["pre", "p", "alpha", "beta", "rc"] +from portage_exceptions import InvalidData def ververify(myver, silent=1): if ver_regexp.match(myver): @@ -262,7 +263,7 @@ def catpkgsplit(mydata,silent=1): 2. If cat is not specificed in mydata, cat will be "null" 3. if rev does not exist it will be '-r0' 4. If cat is invalid (specified but has incorrect syntax) - a ValueError will be thrown + an InvalidData Exception will be thrown """ # Categories may contain a-zA-z0-9+_- but cannot start with - @@ -280,7 +281,7 @@ def catpkgsplit(mydata,silent=1): p_split=pkgsplit(mydata,silent=silent) elif len(mysplit)==2: if not valid_category.match(mysplit[0]): - raise ValueError("Invalid category in %s" %mydata ) + raise InvalidData("Invalid category in %s" %mydata ) retval=[mysplit[0]] p_split=pkgsplit(mysplit[1],silent=silent) if not p_split: |