Skip to content

Commit

Permalink
Revert "Change to using inspect() instead of the current shitty way"
Browse files Browse the repository at this point in the history
This reverts commit 711537d.

Turns out inspect() was introduced in 0.8, and mac-deprecated has 0.6.4 (without an easy way to jack it up). Stuck with this ugly, but functional code for now.
  • Loading branch information
blitzmann committed Apr 24, 2017
1 parent c0f74cd commit f734931
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions eos/gamedata.py
Expand Up @@ -20,7 +20,6 @@
import re

from sqlalchemy.orm import reconstructor
from sqlalchemy import inspect

import eos.db
from eqBase import EqBase
Expand Down Expand Up @@ -444,9 +443,8 @@ def requiresSkill(self, skill, level=None):
@property
def price(self):

# This happens when the price record is deleted from the database. We dynamically refresh the price object
# attached to the fit if it's determined to have been deleted
if self.__price is not None and inspect(self.__price).deleted:
# todo: use `from sqlalchemy import inspect` instead (mac-deprecated doesn't have inspect(), was imp[lemented in 0.8)
if self.__price is not None and getattr(self.__price, '_sa_instance_state', None) and self.__price._sa_instance_state.deleted:
pyfalog.debug("Price data for {} was deleted (probably from a cache reset), resetting object".format(self.ID))
self.__price = None

Expand Down

0 comments on commit f734931

Please sign in to comment.