You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/dev-util/vint/files/vint-0.3.21-fix-py3.8.patch

30 lines
1.4 KiB

From f8bae710ba74dcc55a3b95995fe73139cf949b75 Mon Sep 17 00:00:00 2001
From: Daniel Hahler <git@thequod.de>
Date: Mon, 25 Nov 2019 06:41:39 +0100
Subject: [PATCH] Fix SyntaxWarning with py38 (#334)
> SyntaxWarning: "is not" with a literal. Did you mean "!="?
--- a/vint/ast/plugin/scope_plugin/scope_linker.py
+++ b/vint/ast/plugin/scope_plugin/scope_linker.py
@@ -406,14 +406,17 @@ def _handle_function_node(self, func_node): # type: (Dict[str, Any]) -> None
# We can access "a:firstline" and "a:lastline" if the function is
# declared with an attribute "range". See :func-range
attr = func_node['attr']
- is_declared_with_range = attr['range'] is not 0
+ is_declared_with_range = attr['range'] != 0
if is_declared_with_range:
self._scope_tree_builder.handle_new_range_parameters_found()
# We can access "l:self" is declared with an attribute "dict" or
# the function is a member of a dict. See :help self
- is_declared_with_dict = attr['dict'] is not 0 \
- or NodeType(func_name_node['type']) in FunctionNameNodesDeclaringVariableSelf
+ is_declared_with_dict = (
+ attr["dict"] != 0
+ or NodeType(func_name_node["type"])
+ in FunctionNameNodesDeclaringVariableSelf
+ )
if is_declared_with_dict:
self._scope_tree_builder.handle_new_dict_parameter_found()