File rdesktop-convert-map.python3.patch of Package rdesktop

Index: b/keymaps/convert-map
===================================================================
--- a/keymaps/convert-map
+++ b/keymaps/convert-map
@@ -1,4 +1,5 @@
-#!/usr/bin/env python2
+#!/usr/bin/python3
+# -*- coding: utf-8 -*-
 # -*-Python-*-
 #
 # Copyright 2001 Peter Åstrand <astrand@cendio.se> for Cendio AB
@@ -25,13 +26,13 @@ def main():
         if not line: break
 
         if line.startswith("#") or line.startswith("include"):
-            print line,
+            print(line, end=' ')
             continue
 
         fields = line.split()
 
         if line.startswith("map"):
-            print "map 0x%s" % fields[1]
+            print("map 0x%s" % fields[1])
             continue
 
         scancode = fields[0]
@@ -47,16 +48,16 @@ def main():
             elif pos == 4:
                 modifiers = "shift altgr"
             else:
-                raise("Invalid line: %s" % line)
+                raise "Invalid line: %s"
             
-            print "%s 0x%s %s" % (keysym, scancode, modifiers)
+            print("%s 0x%s %s" % (keysym, scancode, modifiers))
 
 
 
 if __name__ == "__main__":
     if len(sys.argv) < 2:
-        print "Convert old-style keymaps to new style"
-        print "Usage: %s <old-style-keymap>" % sys.argv[0]
+        print("Convert old-style keymaps to new style")
+        print("Usage: %s <old-style-keymap>" % sys.argv[0])
         sys.exit(1)
     else:
         main()
openSUSE Build Service is sponsored by