Skip to content

Commit

Permalink
Merge pull request #241 from zmughal/fix-pr-237
Browse files Browse the repository at this point in the history
Fix PR 237
  • Loading branch information
hlapp committed Aug 11, 2017
2 parents 13077f1 + 5500ea9 commit d56983d
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions Bio/DB/IndexedBase.pm
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ BEGIN {
}

use strict;
no warnings 'once';
use warnings;
use IO::File;
use AnyDBM_File;
use Fcntl;
Expand Down Expand Up @@ -504,7 +504,10 @@ sub get_all_primary_ids {
return keys %{shift->{offsets}};
}

{
no warnings 'once';
*ids = *get_all_ids = \&get_all_primary_ids;
}


=head2 index_file
Expand Down Expand Up @@ -622,7 +625,10 @@ sub get_Seq_by_id {
return $self->{obj_class}->new($self, $id);
}

{
no warnings 'once';
*get_Seq_by_version = *get_Seq_by_primary_id = *get_Seq_by_acc = \&get_Seq_by_id;
}


=head2 _calculate_offsets
Expand Down Expand Up @@ -834,10 +840,9 @@ sub _fh {
my ($self, $id) = @_;
$self->throw('Need to provide a sequence ID') if not defined $id;
my $file = $self->file($id) or return;
eval {
return $self->_fhcache( File::Spec->catfile($self->{dirname}, $file));
};
$self->throw( "Can't open file $file") if $@;;
return eval {
$self->_fhcache( File::Spec->catfile($self->{dirname}, $file));
} or $self->throw( "Can't open file $file" );
}


Expand Down

0 comments on commit d56983d

Please sign in to comment.