eric6/Plugins/CheckerPlugins/CodeStyleChecker/Security/SecurityContext.py

changeset 7614
646742c260bd
parent 7613
382f89c11e27
child 7622
384e2aa5c073
equal deleted inserted replaced
7613:382f89c11e27 7614:646742c260bd
264 264
265 # NameConstants are only part of the AST in Python 3. NameConstants 265 # NameConstants are only part of the AST in Python 3. NameConstants
266 # tend to refer to things like True and False. This prevents them from 266 # tend to refer to things like True and False. This prevents them from
267 # being re-assigned in Python 3. 267 # being re-assigned in Python 3.
268 elif ( 268 elif (
269 sys.version_info >= (3, 0, 0) and 269 sys.version_info[0] >= 3 and
270 isinstance(literal, ast.NameConstant) 270 isinstance(literal, ast.NameConstant)
271 ): 271 ):
272 literalValue = str(literal.value) 272 literalValue = str(literal.value)
273 273
274 # Bytes are only part of the AST in Python 3 274 # Bytes are only part of the AST in Python 3
275 elif ( 275 elif (
276 sys.version_info >= (3, 0, 0) and 276 sys.version_info[0] >= 3 and
277 isinstance(literal, ast.Bytes) 277 isinstance(literal, ast.Bytes)
278 ): 278 ):
279 literalValue = literal.s 279 literalValue = literal.s
280 280
281 else: 281 else:

eric ide

mercurial