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-14-2008, 09:03 AM
Ali Polatel
 
Default fpformat is deprecated, use string interpolation

Hi,
The fpformat module is deprecated and will be removed in py3k.
The % string interpolation operator should be used instead.
Attached patch fixes this.

---
pym/_emerge/__init__.py | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index 7a5c743..9bc06db 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -24,7 +24,6 @@ import array
from collections import deque
import fcntl
import formatter
-import fpformat
import logging
import select
import shlex
@@ -8674,7 +8673,7 @@ class JobStatusDisplay(object):
avg = os.getloadavg()
except OSError, e:
return str(e)
- return ", ".join(fpformat.fix(x, digits) for x in avg)
+ return ", ".join(("%%.%df" % digits ) % x for x in avg)

def display(self):
"""
--
Regards,
Ali Polatel
 

Thread Tools




All times are GMT. The time now is 11:42 PM.

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