Bastien Nocera 93c3758
From 8cdedc1d6716b2bb8ac7a95a00cf696f82ebbc38 Mon Sep 17 00:00:00 2001
Bastien Nocera 93c3758
From: Bastien Nocera <hadess@hadess.net>
Bastien Nocera 93c3758
Date: Tue, 17 Mar 2020 09:37:04 +0100
Bastien Nocera 93c3758
Subject: [PATCH 2/2] tools: Remove outdated "is unicode" checks
Bastien Nocera 93c3758
Bastien Nocera 93c3758
Those aren't needed in Python3, the strings should already be UTF-8.
Bastien Nocera 93c3758
Bastien Nocera 93c3758
Traceback (most recent call last):
Bastien Nocera 93c3758
  File "../tools/glib-ginterface-gen.py", line 840, in <module>
Bastien Nocera 93c3758
    Generator(dom, prefix, basename, signal_marshal_prefix, headers,
Bastien Nocera 93c3758
  File "../tools/glib-ginterface-gen.py", line 739, in __call__
Bastien Nocera 93c3758
    self.h('#include <glib-object.h>')
Bastien Nocera 93c3758
  File "../tools/glib-ginterface-gen.py", line 89, in h
Bastien Nocera 93c3758
    if isinstance(s, unicode):
Bastien Nocera 93c3758
NameError: name 'unicode' is not defined
Bastien Nocera 93c3758
---
Bastien Nocera 93c3758
 tools/glib-ginterface-gen.py | 6 ------
Bastien Nocera 93c3758
 1 file changed, 6 deletions(-)
Bastien Nocera 93c3758
Bastien Nocera 93c3758
diff --git a/tools/glib-ginterface-gen.py b/tools/glib-ginterface-gen.py
Bastien Nocera 93c3758
index e32d7b8..995d874 100644
Bastien Nocera 93c3758
--- a/tools/glib-ginterface-gen.py
Bastien Nocera 93c3758
+++ b/tools/glib-ginterface-gen.py
Bastien Nocera 93c3758
@@ -86,18 +86,12 @@ class Generator(object):
Bastien Nocera 93c3758
         self.allow_havoc = allow_havoc
Bastien Nocera 93c3758
 
Bastien Nocera 93c3758
     def h(self, s):
Bastien Nocera 93c3758
-        if isinstance(s, unicode):
Bastien Nocera 93c3758
-            s = s.encode('utf-8')
Bastien Nocera 93c3758
         self.__header.append(s)
Bastien Nocera 93c3758
 
Bastien Nocera 93c3758
     def b(self, s):
Bastien Nocera 93c3758
-        if isinstance(s, unicode):
Bastien Nocera 93c3758
-            s = s.encode('utf-8')
Bastien Nocera 93c3758
         self.__body.append(s)
Bastien Nocera 93c3758
 
Bastien Nocera 93c3758
     def d(self, s):
Bastien Nocera 93c3758
-        if isinstance(s, unicode):
Bastien Nocera 93c3758
-            s = s.encode('utf-8')
Bastien Nocera 93c3758
         self.__docs.append(s)
Bastien Nocera 93c3758
 
Bastien Nocera 93c3758
     def do_node(self, node):
Bastien Nocera 93c3758
-- 
Bastien Nocera 93c3758
2.25.1
Bastien Nocera 93c3758