From 488067823011ac8638cbdb5d38598dbd99049354 Mon Sep 17 00:00:00 2001 From: Karthikeyan Singaravelan Date: Sat, 23 May 2020 06:19:27 +0000 Subject: [PATCH] Fix warnings in Python 3.8 * Fix deprecation warning due to invalid escape sequences. * Fix syntax warning over comparison of literals using is. --- flask_restful_swagger/swagger.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flask_restful_swagger/swagger.py b/flask_restful_swagger/swagger.py index f9ead0f..a75fa98 100644 --- a/flask_restful_swagger/swagger.py +++ b/flask_restful_swagger/swagger.py @@ -314,7 +314,7 @@ def extract_operations(resource, path_arguments=[]): op['parameters'] = merge_parameter_list( op['parameters'], att_value) else: - if op.get(att_name) and att_name is not 'nickname': + if op.get(att_name) and att_name != 'nickname': att_value = '{0}
{1}'.format(att_value, op[att_name]) op[att_name] = att_value elif isinstance(att_value, object): @@ -525,7 +525,7 @@ def extract_path_arguments(path): {name: 'probability', dataType: 'float'}] """ # Remove all paranteses - path = re.sub('\([^\)]*\)', '', path) + path = re.sub(r'\([^\)]*\)', '', path) args = re.findall('<([^>]+)>', path) def split_arg(arg):