Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
949c71ee
Commit
949c71ee
authored
Sep 01, 2015
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '0.23.x'
parents
659cda6f
067c6cca
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
4 deletions
+15
-4
CHANGES.rst
CHANGES.rst
+2
-0
Cython/Coverage.py
Cython/Coverage.py
+13
-4
No files found.
CHANGES.rst
View file @
949c71ee
...
@@ -40,6 +40,8 @@ Other changes
...
@@ -40,6 +40,8 @@ Other changes
Bugs fixed
Bugs fixed
----------
----------
* Coverage plugin was adapted to coverage.py 4.0 beta 2.
* C++ destructor calls could fail when '&' operator is overwritten.
* C++ destructor calls could fail when '&' operator is overwritten.
* Incorrect handling of large integers in compile-time evaluated DEF
* Incorrect handling of large integers in compile-time evaluated DEF
...
...
Cython/Coverage.py
View file @
949c71ee
...
@@ -205,7 +205,7 @@ class Plugin(CoveragePlugin):
...
@@ -205,7 +205,7 @@ class Plugin(CoveragePlugin):
if self._c_files_map is None:
if self._c_files_map is None:
self._c_files_map = {}
self._c_files_map = {}
for filename, code in code_lines.ite
rite
ms():
for filename, code in code_lines.items():
abs_path = _find_dep_file_path(c_file, filename)
abs_path = _find_dep_file_path(c_file, filename)
self._c_files_map[abs_path] = (c_file, filename, code)
self._c_files_map[abs_path] = (c_file, filename, code)
...
@@ -262,12 +262,15 @@ class CythonModuleReporter(FileReporter):
...
@@ -262,12 +262,15 @@ class CythonModuleReporter(FileReporter):
self.c_file = c_file
self.c_file = c_file
self._code = code
self._code = code
def statements(self):
def lines(self):
return self._code.viewkeys()
"""
Return set of line numbers that are possibly executable.
"""
return set(self._code)
def _iter_source_tokens(self):
def _iter_source_tokens(self):
current_line = 1
current_line = 1
for line_no, code_line in sorted(self._code.ite
rite
ms()):
for line_no, code_line in sorted(self._code.items()):
while line_no > current_line:
while line_no > current_line:
yield []
yield []
current_line += 1
current_line += 1
...
@@ -275,6 +278,9 @@ class CythonModuleReporter(FileReporter):
...
@@ -275,6 +278,9 @@ class CythonModuleReporter(FileReporter):
current_line += 1
current_line += 1
def source(self):
def source(self):
"""
Return the source code of the file as a string.
"""
if os.path.exists(self.filename):
if os.path.exists(self.filename):
with open_source_file(self.filename) as f:
with open_source_file(self.filename) as f:
return f.read()
return f.read()
...
@@ -284,6 +290,9 @@ class CythonModuleReporter(FileReporter):
...
@@ -284,6 +290,9 @@ class CythonModuleReporter(FileReporter):
for tokens in self._iter_source_tokens())
for tokens in self._iter_source_tokens())
def source_token_lines(self):
def source_token_lines(self):
"""
Iterate over the source code tokens.
"""
if os.path.exists(self.filename):
if os.path.exists(self.filename):
with open_source_file(self.filename) as f:
with open_source_file(self.filename) as f:
for line in f:
for line in f:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment