Commits

Bouke Versteegh  committed 23c9256

Don't use python 2.7 syntax. Import alternative module for OrderedDicts if available.

  • Participants
  • Parent commits 45adcdc

Comments (0)

Files changed (2)

File src/eyed3/id3/tag.py

         flist = list(convert_list)
 
         # Date frame conversions.
-        date_frames = {f.id: f for f in flist if f.id in DEPRECATED_DATE_FIDS}\
-                      if version == ID3_V2_4 else \
-                      {f.id: f for f in flist if f.id in DATE_FIDS}
+        date_frames = {}
+        for f in flist:
+            if version == ID3_V2_4:
+                if f.id in DEPRECATED_DATE_FIDS:
+                    date_frames[f.id] = f
+            else:
+                if f.id in DATE_FIDS:
+                    date_frames[f.id] = f
+        
         if date_frames:
             if version == ID3_V2_4:
                 if "TORY" in date_frames or "XDOR" in date_frames:

File src/eyed3/plugins/__init__.py

 ################################################################################
 from __future__ import print_function
 import os, sys, logging, exceptions, types
-from collections import OrderedDict
+
+try:
+    from collections import OrderedDict
+except ImportError:
+    from ordereddict import OrderedDict
 from eyed3 import core, utils
 from eyed3.utils.cli import printMsg, printError