Commit 98788d3c authored by Alex Gaynor's avatar Alex Gaynor
Browse files

Remove some unnecesary uses of bool

parent a921f063
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -86,7 +86,7 @@ class DataSource(GDALBase):
        else:
            raise OGRException('Invalid data source input type: %s' % type(ds_input))

        if bool(ds):
        if ds:
            self.ptr = ds
            self.driver = Driver(ds_driver)
        else:
+1 −1
Original line number Diff line number Diff line
@@ -122,7 +122,7 @@ class OGRGeometry(GDALBase):
        self.ptr = g

        # Assigning the SpatialReference object to the geometry, if valid.
        if bool(srs):
        if srs:
            self.srs = srs

        # Setting the class depending upon the OGR Geometry Type
+1 −1
Original line number Diff line number Diff line
@@ -111,7 +111,7 @@ def check_pointer(result, func, cargs):
    "Makes sure the result pointer is valid."
    if isinstance(result, six.integer_types):
        result = c_void_p(result)
    if bool(result):
    if result:
        return result
    else:
        raise OGRException('Invalid pointer returned from "%s"' % func.__name__)
+1 −1
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@ GeoIPRecord_delete.restype = None

# For retrieving records by name or address.
def check_record(result, func, cargs):
    if bool(result):
    if result:
        # Checking the pointer to the C structure, if valid pull out elements
        # into a dicionary.
        rec = result.contents
+1 −1
Original line number Diff line number Diff line
@@ -89,7 +89,7 @@ class GEOSGeometry(GEOSBase, ListMixin):
            # Invalid geometry type.
            raise TypeError('Improper geometry input type: %s' % str(type(geo_input)))

        if bool(g):
        if g:
            # Setting the pointer object with a valid pointer.
            self.ptr = g
        else:
Loading