Skip to content

Commit

Permalink
Move buffer redefinition to module scope
Browse files Browse the repository at this point in the history
  • Loading branch information
mdshw5 committed May 12, 2018
1 parent 3a102af commit 5eab863
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pyfaidx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
from math import ceil
from threading import Lock

if sys.version_info > (3, ):
buffer = memoryview

dna_bases = re.compile(r'([ACTGNactgnYRWSKMDVHBXyrwskmdvhbx]+)')

__version__ = '0.5.4'
Expand Down Expand Up @@ -892,8 +895,6 @@ def long_name(self):
@property
def __array_interface__(self):
""" Implement numpy array interface for issue #139"""
if sys.version_info > (3, ):
buffer = memoryview
return {
'shape': (len(self), ),
'typestr': '|S1',
Expand Down

0 comments on commit 5eab863

Please sign in to comment.