From 80559e4879b9c150b2753a44a53cf83b0c4b5355 Mon Sep 17 00:00:00 2001 From: Radostin Stoyanov Date: Tue, 20 Mar 2018 06:48:44 +0000 Subject: [PATCH] apibuild: Use isinstance for type checking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The isinstance() function [1] returns true if an object argument is an instance of a classinfo argument or of a direct, indirect subclass thereof. 1: https://docs.python.org/3/library/functions.html#isinstance Reviewed-by: Daniel P. Berrangé Signed-off-by: Radostin Stoyanov --- docs/apibuild.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/apibuild.py b/docs/apibuild.py index 17d14a0c55..832f04ab15 100755 --- a/docs/apibuild.py +++ b/docs/apibuild.py @@ -742,7 +742,7 @@ class CParser: return line def cleanupComment(self): - if type(self.comment) != type(""): + if not isinstance(self.comment, str): return # remove the leading * on multi-line comments lines = self.comment.splitlines(True) @@ -2223,9 +2223,8 @@ class docBuilder: output.write(" \n") try: for field in self.idx.structs[name].info: -- GitLab