File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -374,7 +374,7 @@ def syntax_error_message(exception, unit):
374
374
375
375
def recursion_error_message (exception , unit ):
376
376
# if unit is a BuiltinModuleExtractable, there will be no path attribute
377
- l = Location (file = getattr (unit , "path" , str ( unit )))
377
+ l = Location (file = unit . path ) if hasattr (unit , "path" ) else None
378
378
return (DiagnosticMessage (Source ("py/diagnostics/recursion-error" , "Recursion error in Python extractor" ), Severity .ERROR )
379
379
.with_location (l )
380
380
.text (exception .args [0 ])
@@ -385,7 +385,7 @@ def recursion_error_message(exception, unit):
385
385
386
386
def internal_error_message (exception , unit ):
387
387
# if unit is a BuiltinModuleExtractable, there will be no path attribute
388
- l = Location (file = getattr (unit , "path" , str ( unit )))
388
+ l = Location (file = unit . path ) if hasattr (unit , "path" ) else None
389
389
return (DiagnosticMessage (Source ("py/diagnostics/internal-error" , "Internal error in Python extractor" ), Severity .ERROR )
390
390
.with_location (l )
391
391
.text ("Internal error" )
You can’t perform that action at this time.
0 commit comments