aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/pytest/py2/_pytest/_code/source.py
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.ru>2022-02-10 16:44:30 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:44:30 +0300
commit2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch)
tree012bb94d777798f1f56ac1cec429509766d05181 /contrib/python/pytest/py2/_pytest/_code/source.py
parent6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff)
downloadydb-2598ef1d0aee359b4b6d5fdd1758916d5907d04f.tar.gz
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/python/pytest/py2/_pytest/_code/source.py')
-rw-r--r--contrib/python/pytest/py2/_pytest/_code/source.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/contrib/python/pytest/py2/_pytest/_code/source.py b/contrib/python/pytest/py2/_pytest/_code/source.py
index b35e97b9cec..74e9c776000 100644
--- a/contrib/python/pytest/py2/_pytest/_code/source.py
+++ b/contrib/python/pytest/py2/_pytest/_code/source.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
@@ -128,8 +128,8 @@ class Source(object):
else:
source = str(self)
try:
- ast.parse(source)
- except (SyntaxError, ValueError, TypeError):
+ ast.parse(source)
+ except (SyntaxError, ValueError, TypeError):
return False
else:
return True
@@ -199,9 +199,9 @@ def compile_(source, filename=None, mode="exec", flags=0, dont_inherit=0):
def getfslineno(obj):
""" Return source location (path, lineno) for the given object.
- If the source cannot be determined return ("", -1).
-
- The line number is 0-based.
+ If the source cannot be determined return ("", -1).
+
+ The line number is 0-based.
"""
from .code import Code
@@ -235,7 +235,7 @@ def getfslineno(obj):
def findsource(obj):
try:
sourcelines, lineno = inspect.findsource(obj)
- except Exception:
+ except Exception:
return None, -1
source = Source()
source.lines = [line.rstrip() for line in sourcelines]