Skip to content

Commit

Permalink
fixed subsequence none
Browse files Browse the repository at this point in the history
  • Loading branch information
lmdu committed Nov 25, 2023
1 parent ee7303d commit ce4ffc8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
5 changes: 5 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Changelog
=========

Version 2.0.2 (2023-11-25)
--------------------------

- Fixed subsequence return None error

Version 2.0.1 (2023-09-18)
--------------------------

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def prepare_indexed_gzip():
])

if sys.platform.startswith('linux'):
link_args.extend(['-lz', '-lsqlite3'])
link_args.extend(['-lsqlite3'])
comp_args.extend([
'-D_LFS64_LARGEFILE',
'-D_LARGEFILE64_SOURCE',
Expand All @@ -85,9 +85,9 @@ def prepare_indexed_gzip():
comp_args.append('-DHAVE_UNISTD_H')

if not sys.platform.startswith('linux'):
prepare_zlib()
prepare_sqlite3()

prepare_zlib()
prepare_indexed_gzip()

extension = Extension('pyfastx',
Expand Down
10 changes: 6 additions & 4 deletions src/sequence.c
Original file line number Diff line number Diff line change
Expand Up @@ -457,16 +457,18 @@ PyObject *pyfastx_sequence_subscript(pyfastx_Sequence* self, PyObject* item){
// return NULL;
//}

if (slice_len <= 0) {
Py_RETURN_NONE;
}
//if (slice_len <= 0) {
// Py_RETURN_NONE;
//}

if (slice_step == 0) {
PyErr_SetString(PyExc_ValueError, "slice step cannot be zero");
return NULL;
}

if (slice_step != 1) {
Py_RETURN_NONE;
PyErr_SetString(PyExc_ValueError, "slice step cannot > 1");
return NULL;
}

//create a new sequence
Expand Down
2 changes: 1 addition & 1 deletion src/version.h
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#define PYFASTX_VERSION "2.0.1"
#define PYFASTX_VERSION "2.0.2"
#define ZRAN_VERSION "1.7.0"

0 comments on commit ce4ffc8

Please sign in to comment.