Skip to content

Commit 25a236b

Browse files
committed
0.6.7
- (#143) Correct a failure when no source information is available Signed-off-by: Matthew Ballance <matt.ballance@gmail.com>
1 parent 83ad6d4 commit 25a236b

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

doc/Changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11

2+
## 0.6.7
3+
- (#143) Correct a failure when no source information is available
4+
25
## 0.6.6
36
- #(142) Resolve random instability due to use of 'dist' constraints
47

etc/ivpm.info

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11

22
name=pyvsc
3-
version=0.6.6
3+
version=0.6.7
44

src/vsc/coverage.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,18 @@ def configure_options(self, *args, **kwargs):
270270

271271
# Store declaration information on the type
272272
if hasattr(T, "__file__"):
273-
file = inspect.getsourcefile(T)
274-
lineno = inspect.getsourcelines(T)[1]
273+
try:
274+
file = inspect.getsourcefile(T)
275+
if file is not None:
276+
lineno = inspect.getsourcelines(T)[1]
277+
else:
278+
file = "<unknown>"
279+
lineno = -1
280+
except Exception:
281+
# In case an exception is encountered -- perhaps due to
282+
# the code being Cython compiled
283+
file = "<unknown>"
284+
lineno = -1
275285
else:
276286
file = "<unknown>"
277287
lineno = -1

0 commit comments

Comments
 (0)