Permalink
Browse files

[FakeDBI.pm6] put the DBD 'use' commands into an eval, to avoid faili…

…ng on not installed driver modules
  • Loading branch information...
1 parent f8bd692 commit a6f314b5df01d2d0707c37987265490fec960a13 Martin Berends committed Jun 29, 2010
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/FakeDBI.pm6
View
@@ -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;

0 comments on commit a6f314b

Please sign in to comment.