@@ -650,18 +650,13 @@ MySQL_use_unicode(MySQL *self, PyObject *args)
650
650
651
651
@param self MySQL instance
652
652
653
- @return PyInt_Type or PyNone
653
+ @return PyInt_Type
654
654
@retval PyInt_Type OK
655
- @retval PyNone no active session
656
655
*/
657
656
PyObject *
658
657
MySQL_st_affected_rows (MySQL * self )
659
658
{
660
- if (& self -> session ) {
661
- return PyLong_FromUnsignedLongLong ((& self -> session )-> affected_rows );
662
- }
663
-
664
- Py_RETURN_NONE ;
659
+ return PyLong_FromUnsignedLongLong ((& self -> session )-> affected_rows );
665
660
}
666
661
667
662
/**
@@ -671,18 +666,13 @@ MySQL_st_affected_rows(MySQL *self)
671
666
672
667
@param self MySQL instance
673
668
674
- @return PyInt_Type or PyNone
669
+ @return PyInt_Type
675
670
@retval PyInt_Type OK
676
- @retval PyNone no active session
677
671
*/
678
672
PyObject *
679
673
MySQL_st_client_flag (MySQL * self )
680
674
{
681
- if (& self -> session ) {
682
- return PyLong_FromLong ((& self -> session )-> client_flag );
683
- }
684
-
685
- Py_RETURN_NONE ;
675
+ return PyLong_FromLong ((& self -> session )-> client_flag );
686
676
}
687
677
688
678
/**
@@ -692,18 +682,13 @@ MySQL_st_client_flag(MySQL *self)
692
682
693
683
@param self MySQL instance
694
684
695
- @return PyInt_Type or PyNone
685
+ @return PyInt_Type
696
686
@retval PyInt_Type OK
697
- @retval PyNone no active session
698
687
*/
699
688
PyObject *
700
689
MySQL_st_field_count (MySQL * self )
701
690
{
702
- if (& self -> session ) {
703
- return PyLong_FromLong ((& self -> session )-> field_count );
704
- }
705
-
706
- Py_RETURN_NONE ;
691
+ return PyLong_FromLong ((& self -> session )-> field_count );
707
692
}
708
693
709
694
/**
@@ -713,18 +698,13 @@ MySQL_st_field_count(MySQL *self)
713
698
714
699
@param self MySQL instance
715
700
716
- @return PyInt_Type or PyNone
701
+ @return PyInt_Type
717
702
@retval PyInt_Type OK
718
- @retval PyNone no active session
719
703
*/
720
704
PyObject *
721
705
MySQL_st_insert_id (MySQL * self )
722
706
{
723
- if (& self -> session ) {
724
- return PyLong_FromUnsignedLongLong ((& self -> session )-> insert_id );
725
- }
726
-
727
- Py_RETURN_NONE ;
707
+ return PyLong_FromUnsignedLongLong ((& self -> session )-> insert_id );
728
708
}
729
709
730
710
/**
@@ -734,18 +714,13 @@ MySQL_st_insert_id(MySQL *self)
734
714
735
715
@param self MySQL instance
736
716
737
- @return PyInt_Type or PyNone
717
+ @return PyInt_Type
738
718
@retval PyInt_Type OK
739
- @retval PyNone no active session
740
719
*/
741
720
PyObject *
742
721
MySQL_st_server_capabilities (MySQL * self )
743
722
{
744
- if (& self -> session ) {
745
- return PyLong_FromLong ((& self -> session )-> server_capabilities );
746
- }
747
-
748
- Py_RETURN_NONE ;
723
+ return PyLong_FromLong ((& self -> session )-> server_capabilities );
749
724
}
750
725
751
726
/**
@@ -755,18 +730,13 @@ MySQL_st_server_capabilities(MySQL *self)
755
730
756
731
@param self MySQL instance
757
732
758
- @return PyInt_Type or PyNone
733
+ @return PyInt_Type
759
734
@retval PyInt_Type OK
760
- @retval PyNone no active session
761
735
*/
762
736
PyObject *
763
737
MySQL_st_server_status (MySQL * self )
764
738
{
765
- if (& self -> session ) {
766
- return PyLong_FromLong ((& self -> session )-> server_status );
767
- }
768
-
769
- Py_RETURN_NONE ;
739
+ return PyLong_FromLong ((& self -> session )-> server_status );
770
740
}
771
741
772
742
/**
@@ -776,18 +746,13 @@ MySQL_st_server_status(MySQL *self)
776
746
777
747
@param self MySQL instance
778
748
779
- @return PyInt_Type or PyNone
749
+ @return PyInt_Type
780
750
@retval PyInt_Type OK
781
- @retval PyNone no active session
782
751
*/
783
752
PyObject *
784
753
MySQL_st_warning_count (MySQL * self )
785
754
{
786
- if (& self -> session ) {
787
- return PyLong_FromLong ((& self -> session )-> warning_count );
788
- }
789
-
790
- Py_RETURN_NONE ;
755
+ return PyLong_FromLong ((& self -> session )-> warning_count );
791
756
}
792
757
793
758
/**
@@ -2644,7 +2609,7 @@ MySQL_fetch_row(MySQL *self)
2644
2609
if (field_type == MYSQL_TYPE_TINY || field_type == MYSQL_TYPE_SHORT ||
2645
2610
field_type == MYSQL_TYPE_LONG || field_type == MYSQL_TYPE_LONGLONG ||
2646
2611
field_type == MYSQL_TYPE_INT24 || field_type == MYSQL_TYPE_YEAR ) {
2647
- if (field_flags && ZEROFILL_FLAG ) {
2612
+ if (field_flags & ZEROFILL_FLAG ) {
2648
2613
PyTuple_SET_ITEM (result_row , i , PyLong_FromString (row [i ], NULL , 10 ));
2649
2614
}
2650
2615
else {
0 commit comments