[meld] Fix Decimal usage for Python 2.6 compat



commit 8e542f16e55288554b0c96e5d6e902005f1f0f59
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sun Feb 10 07:20:17 2013 +1000

    Fix Decimal usage for Python 2.6 compat

 meld/dirdiff.py |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/meld/dirdiff.py b/meld/dirdiff.py
index 412be6c..974a4ab 100644
--- a/meld/dirdiff.py
+++ b/meld/dirdiff.py
@@ -64,8 +64,10 @@ class StatItem(namedtuple('StatItem', 'mode size time')):
         if self.size != other.size:
             return False
 
-        mtime1 = Decimal(self.time).scaleb(9).quantize(1) // prefs.dirdiff_time_resolution_ns
-        mtime2 = Decimal(other.time).scaleb(9).quantize(1) // prefs.dirdiff_time_resolution_ns
+        dectime1 = Decimal(str(self.time)).scaleb(Decimal(9)).quantize(1)
+        dectime2 = Decimal(str(other.time)).scaleb(Decimal(9)).quantize(1)
+        mtime1 = dectime1 // prefs.dirdiff_time_resolution_ns
+        mtime2 = dectime2 // prefs.dirdiff_time_resolution_ns
 
         return mtime1 == mtime2
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]