Commits

Luke Plant  committed 853c378

Python 3 fixes

  • Participants
  • Parent commits b069164

Comments (0)

Files changed (4)

 -----------
 
 * New 'install_cinnamon' command to properly support Cinnamon 2.0 and higher.
+* Fixed some Python 3 compatibility issues, dropped support for Python < 2.7
 
 Version 0.8
 -----------

File playerdo/install.py

 import sys
 
 
+if sys.version_info.major > 2:
+    unicode = str
+
+
 def force_unicode(s):
     if type(s) is not unicode:
         return s.decode('UTF-8')

File playerdo/main.py

         states.append(state)
         orders.append(p.sort_order)
 
-    l = zip(states, orders, players)
+    l = list(zip(states, orders, players))
     l.sort()
 
     return [x[2] for x in l]
             sys.stderr.write("Operation '%s' not supported for player '%s'.\n" %
                              (command, player.friendly_name))
             sys.exit(1)
-        except PlayerException, e:
+        except PlayerException as e:
             sys.stderr.write(e.message + "\n")
             sys.exit(1)
     sys.stderr.write("No players running!\n")
         "Development Status :: 4 - Beta",
         "Intended Audience :: End Users/Desktop",
         "Operating System :: POSIX :: Linux",
-        "Programming Language :: Python :: 2.5",
-        "Programming Language :: Python :: 2.6",
         "Programming Language :: Python :: 2.7",
         "Programming Language :: Python :: 3",
         "Programming Language :: Python :: 3.0",