Skip to content
This repository has been archived by the owner on Aug 1, 2021. It is now read-only.

Commit

Permalink
Fix py2.x inspect.getargspec
Browse files Browse the repository at this point in the history
  • Loading branch information
b1naryth1ef committed Oct 7, 2016
1 parent ef295de commit 0b48de0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Disco is currently in an early-alpha phase. What you see today may change a lot

## Installation

Disco was built to run both as a generic-use library, and a standalone bot toolkit. Installing disco is as easy as running `pip install disco`, however some extra packages are recommended for power-users, namely:
Disco was built to run both as a generic-use library, and a standalone bot toolkit. Installing disco is as easy as running `pip install disco-py`, however some extra packages are recommended for power-users, namely:

|Name|Reason|
|----|------|
Expand Down
10 changes: 5 additions & 5 deletions disco/types/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@


def _make(typ, data, client):
args, _, _, _ = inspect.getargspec(typ)
if 'client' in args:
return typ(data, client)
if inspect.isfunction(typ):
args, _, _, _ = inspect.getargspec(typ)
if 'client' in args:
return typ(data, client)
return typ(data)


Expand Down Expand Up @@ -118,7 +119,7 @@ def __init__(self, obj, client=None):
continue

try:
if client:
if client and inspect.isfunction(typ):
args, _, _, _ = inspect.getargspec(typ)
if 'client' in args:
v = typ(obj[name], client)
Expand Down Expand Up @@ -146,7 +147,6 @@ def update(self, other):
if isinstance(getattr(type(self), name), property):
delattr(self, name)


@classmethod
def create(cls, client, data):
return cls(data, client)
Expand Down

0 comments on commit 0b48de0

Please sign in to comment.