Skip to content

Commit

Permalink
Address feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
hannosch committed Jan 19, 2017
1 parent 7b81700 commit 4e94792
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
15 changes: 4 additions & 11 deletions src/Persistence/_Persistence.c
Expand Up @@ -94,19 +94,14 @@ static PyObject *
P_getattr(cPersistentObject *self, PyObject *name)
{
PyObject *v=NULL;
char *s;

name = convert_name(name);
if (!name)
PyObject* as_bytes = convert_name(name);
if (!as_bytes)
return NULL;

#ifdef PY3K
s = PyBytes_AS_STRING(name);
#else
s = PyString_AS_STRING(name);
#endif
char *s = PyBytes_AS_STRING(as_bytes);

if (*s != '_' || unghost_getattr(s))
if (s[0] != '_' || unghost_getattr(s))
{
if (PER_USE(self))
{
Expand All @@ -118,8 +113,6 @@ P_getattr(cPersistentObject *self, PyObject *name)
else
v = Py_FindAttr((PyObject*)self, name);

Py_DECREF(name);

return v;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Persistence/__init__.py
Expand Up @@ -52,7 +52,7 @@ def __getattribute__(self, name):

if 'PURE_PYTHON' not in os.environ: # pragma no cover
try:
from _Persistence import Persistent # NOQA
from Persistence._Persistence import Persistent # NOQA
except ImportError:
pass

Expand Down

0 comments on commit 4e94792

Please sign in to comment.