Skip to content

Commit

Permalink
[FakeDBI.pm6] put the DBD 'use' commands into an eval, to avoid faili…
Browse files Browse the repository at this point in the history
…ng on not installed driver modules
  • Loading branch information
Martin Berends committed Jun 29, 2010
1 parent f8bd692 commit a6f314b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/FakeDBI.pm6
Expand Up @@ -25,8 +25,8 @@ class FakeDBI:auth<mberends>:ver<0.0.1> {
}
my $driver;
given $drivername {
when 'CSV' { use FakeDBD::CSV; $driver = FakeDBD::CSV.new(); }
when 'mysql' { use FakeDBD::mysql; $driver = FakeDBD::mysql.new(); }
when 'CSV' { eval 'use FakeDBD::CSV; $driver = FakeDBD::CSV.new()' }
when 'mysql' { eval 'use FakeDBD::mysql; $driver = FakeDBD::mysql.new()' }
default { die "driver name '$drivername' is not known"; }
}
return $driver;
Expand Down

0 comments on commit a6f314b

Please sign in to comment.