[damned-lies] Fixes #213 - Add support for translate-toolkit 3.3+



commit 3c1bafc5be6aafefb7ef9e46ad42ed0114c314aa
Author: Claude Paroz <claude 2xlibre net>
Date:   Tue Jan 5 21:52:22 2021 +0100

    Fixes #213 - Add support for translate-toolkit 3.3+

 stats/utils.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/stats/utils.py b/stats/utils.py
index f05a8c75..31b715a7 100644
--- a/stats/utils.py
+++ b/stats/utils.py
@@ -554,7 +554,11 @@ def po_file_stats(pofile):
         ))
         return res
 
-    status = pocount.calcstats_old(str(pofile))
+    try:
+        status = pocount.calcstats_old(str(pofile))
+    except AttributeError:
+        # From translate-toolkit 3.3
+        status = pocount.calcstats(str(pofile))
     if not status:
         res['errors'].append((
             "error",


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