X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FCensus.py;h=b72da0cbd7133e66f9fb9f5c63b7c641fc58180a;hb=3ab8463a642a3540da604d266d57a6d5af7485cc;hp=761b380ba15f70c22ff75baf202cda86e8b501b8;hpb=11ea27e0ead248685616399a51c30d6af56a524f;p=dead%2Fcensus-tools.git diff --git a/src/Census.py b/src/Census.py index 761b380..b72da0c 100644 --- a/src/Census.py +++ b/src/Census.py @@ -25,7 +25,10 @@ class Database: def __del__(self): - self.connection.close() + try: + self.connection.close() + except: + pass def find_average_population_density(self, coords): @@ -60,7 +63,7 @@ class Database: """ cursor = self.connection.cursor() - # We're ready to build our query, one step at a time. Firsy, we store + # We're ready to build our query, one step at a time. First, we store # the Text->Geom conversion in a variable; this just makes the query a # little easier to read. geometric_object = "ST_GeomFromText(%s, %d)"