diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:39 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:39 +0300 |
commit | e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0 (patch) | |
tree | 64175d5cadab313b3e7039ebaa06c5bc3295e274 /contrib/python/pytest/py2/_pytest/_code/source.py | |
parent | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (diff) | |
download | ydb-e9656aae26e0358d5378e5b63dcac5c8dbe0e4d0.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/python/pytest/py2/_pytest/_code/source.py')
-rw-r--r-- | contrib/python/pytest/py2/_pytest/_code/source.py | 14 |
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 74e9c776000..b35e97b9cec 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] |