Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tickets/dm 11861 SqlRegistry raising exception due to missing super.__del__ #79

Merged
merged 3 commits into from
Sep 12, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 deletions python/lsst/daf/persistence/registries.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
local filesystem only, so this works for the time being.
"""
from __future__ import absolute_import
from builtins import object
from builtins import object, super
from past.builtins import basestring

import copy
Expand Down Expand Up @@ -68,6 +68,9 @@ class Registry(object):
def __init__(self):
pass

def __del__(self):
pass

@staticmethod
def create(location):
"""Create a registry object of an appropriate type.
Expand Down Expand Up @@ -316,8 +319,9 @@ def __init__(self, conn):
self.conn = conn

def __del__(self):
self.conn.close()
super(SqlRegistry, self).__del__()
if self.conn:
self.conn.close()
super().__del__()

def lookup(self, lookupProperties, reference, dataId, **kwargs):
"""Perform a lookup in the registry.
Expand Down Expand Up @@ -439,10 +443,6 @@ def __init__(self, location):
user=config["user"], password=config["password"])
SqlRegistry.__init__(self, conn)

def __del__(self):
if self.conn:
self.conn.close()

@staticmethod
def readYaml(location):
"""Read YAML configuration file
Expand Down