Blob Blame History Raw
From 8cdedc1d6716b2bb8ac7a95a00cf696f82ebbc38 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Tue, 17 Mar 2020 09:37:04 +0100
Subject: [PATCH 2/2] tools: Remove outdated "is unicode" checks

Those aren't needed in Python3, the strings should already be UTF-8.

Traceback (most recent call last):
  File "../tools/glib-ginterface-gen.py", line 840, in <module>
    Generator(dom, prefix, basename, signal_marshal_prefix, headers,
  File "../tools/glib-ginterface-gen.py", line 739, in __call__
    self.h('#include <glib-object.h>')
  File "../tools/glib-ginterface-gen.py", line 89, in h
    if isinstance(s, unicode):
NameError: name 'unicode' is not defined
---
 tools/glib-ginterface-gen.py | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/tools/glib-ginterface-gen.py b/tools/glib-ginterface-gen.py
index e32d7b8..995d874 100644
--- a/tools/glib-ginterface-gen.py
+++ b/tools/glib-ginterface-gen.py
@@ -86,18 +86,12 @@ class Generator(object):
         self.allow_havoc = allow_havoc
 
     def h(self, s):
-        if isinstance(s, unicode):
-            s = s.encode('utf-8')
         self.__header.append(s)
 
     def b(self, s):
-        if isinstance(s, unicode):
-            s = s.encode('utf-8')
         self.__body.append(s)
 
     def d(self, s):
-        if isinstance(s, unicode):
-            s = s.encode('utf-8')
         self.__docs.append(s)
 
     def do_node(self, node):
-- 
2.25.1