From 58b56a401ebd833ce4418dffdf8167251355e843 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 7 Jun 2006 12:39:52 +0000 Subject: [PATCH] If lchown is unavailable for some unexpected reason, make all lchown calls print a warning message (bug #135398). svn path=/main/trunk/; revision=3466 --- pym/portage_data.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pym/portage_data.py b/pym/portage_data.py index 760ab3ea2..bd556b519 100644 --- a/pym/portage_data.py +++ b/pym/portage_data.py @@ -31,11 +31,14 @@ if not lchown: # Included in python-2.3 lchown = os.lchown else: - import missingos - lchown = missingos.lchown + try: + import missingos + lchown = missingos.lchown + except ImportError: + def lchown(*pos_args, **key_args): + writemsg(red("!!!") + " It seems that os.lchown does not" + \ + " exist. Please rebuild python.\n", noiselevel=-1) - - os.environ["USERLAND"]=userland # Portage has 3 security levels that depend on the uid and gid of the main -- 2.26.2