From 78e0bb2880305bb71b54af0f2ec2e1a51927d1f5 Mon Sep 17 00:00:00 2001 From: William Ting Date: Tue, 14 May 2013 21:58:23 -0500 Subject: [PATCH] explicit imports for NamedTemporaryFile --- bin/autojump | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/autojump b/bin/autojump index b1c5566..355e469 100755 --- a/bin/autojump +++ b/bin/autojump @@ -37,7 +37,7 @@ import os import re import shutil import sys -from tempfile import NamedTemporaryFile +import tempfile class Database: """ @@ -165,7 +165,9 @@ class Database: if ((not os.path.exists(self.filename)) or os.name == 'nt' or os.getuid() == os.stat(self.filename)[4]): - temp = NamedTemporaryFile(dir=self.config['data'], delete=False) + temp = tempfile.NamedTemporaryFile(dir=self.config['data'], + delete=False) + for path, weight in sorted(self.data.items(), key=operator.itemgetter(1), reverse=True):