FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo Portage Developer

 
 
LinkBack Thread Tools
 
Old 08-15-2008, 03:13 PM
Ali Polatel
 
Default Fix warning for lib2to3/fixes/fix_map.py

2to3 gives a warning while converting portage codebase using map¹ fix:
RefactoringTool: Warnings/messages while refactoring:
RefactoringTool: ### In file ./pym/portage/dbapi/porttree.py ###
RefactoringTool: Line 266: You should use a for loop here

This is a valid warning because map() will change in py3k. Read the docstring of
fix_map.py for more information.

¹: http://svn.python.org/view/python/trunk/Lib/lib2to3/fixes/fix_map.py

---
pym/portage/dbapi/porttree.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
index 2948ba6..4e76b1e 100644
--- a/pym/portage/dbapi/porttree.py
+++ b/pym/portage/dbapi/porttree.py
@@ -263,7 +263,8 @@ class portdbapi(dbapi):
# if newer version, wipe everything and negate eapi
eapi = metadata["EAPI"]
metadata = {}
- map(lambda x: metadata.setdefault(x, ""), auxdbkeys)
+ for x in auxdbkeys:
+ metadata.setdefault(x, "")
metadata["EAPI"] = "-" + eapi

if metadata.get("INHERITED", False):
--
Regards,
Ali Polatel
 

Thread Tools




All times are GMT. The time now is 10:03 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org