Skip to content

Commit ce4ffc8

Browse files
committed
fixed subsequence none
1 parent ee7303d commit ce4ffc8

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

docs/changelog.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Changelog
22
=========
33

4+
Version 2.0.2 (2023-11-25)
5+
--------------------------
6+
7+
- Fixed subsequence return None error
8+
49
Version 2.0.1 (2023-09-18)
510
--------------------------
611

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def prepare_indexed_gzip():
7575
])
7676

7777
if sys.platform.startswith('linux'):
78-
link_args.extend(['-lz', '-lsqlite3'])
78+
link_args.extend(['-lsqlite3'])
7979
comp_args.extend([
8080
'-D_LFS64_LARGEFILE',
8181
'-D_LARGEFILE64_SOURCE',
@@ -85,9 +85,9 @@ def prepare_indexed_gzip():
8585
comp_args.append('-DHAVE_UNISTD_H')
8686

8787
if not sys.platform.startswith('linux'):
88-
prepare_zlib()
8988
prepare_sqlite3()
9089

90+
prepare_zlib()
9191
prepare_indexed_gzip()
9292

9393
extension = Extension('pyfastx',

src/sequence.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -457,16 +457,18 @@ PyObject *pyfastx_sequence_subscript(pyfastx_Sequence* self, PyObject* item){
457457
// return NULL;
458458
//}
459459

460-
if (slice_len <= 0) {
461-
Py_RETURN_NONE;
462-
}
460+
//if (slice_len <= 0) {
461+
// Py_RETURN_NONE;
462+
//}
463463

464464
if (slice_step == 0) {
465465
PyErr_SetString(PyExc_ValueError, "slice step cannot be zero");
466+
return NULL;
466467
}
467468

468469
if (slice_step != 1) {
469-
Py_RETURN_NONE;
470+
PyErr_SetString(PyExc_ValueError, "slice step cannot > 1");
471+
return NULL;
470472
}
471473

472474
//create a new sequence

src/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
#define PYFASTX_VERSION "2.0.1"
1+
#define PYFASTX_VERSION "2.0.2"
22
#define ZRAN_VERSION "1.7.0"

0 commit comments

Comments
 (0)