Project

General

Profile

Actions

Bug #16607

closed

retried require does not raise Exception even if a library has SyntaxError

Added by gotoken (Kentaro Goto) almost 2 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux]
[ruby-core:97057]

Description

From shell:

% echo "class C" > c.rb
% ruby -e 'begin p require "./c" ; rescue SyntaxError; end; p require "./c"; C'

expected result: SyntaxError
2.7 and current master output:

false
Traceback (most recent call last):
-e:1:in `<main>': uninitialized constant C (NameError)
Actions

Also available in: Atom PDF