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

update for python 3.2 and higher #176

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
update for python 3.2 and higher
  • Loading branch information
enisgetmez authored Nov 20, 2021
commit 9d388b855fe861502b5aba1403a878360cfe8542
8 changes: 4 additions & 4 deletions smop/libsmop.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# MIT license

import __builtin__
import builtins

import numpy
from numpy import sqrt,prod,exp,log,dot,multiply,inf
Expand Down Expand Up @@ -523,7 +523,7 @@ def isscalar(a):

def length(a):
try:
return __builtin__.max(np.asarray(a).shape)
return builtins.max(np.asarray(a).shape)
except ValueError:
return 1

Expand Down Expand Up @@ -645,7 +645,7 @@ def size(a, b=0, nargout=1):
matlabarray([[4, 4]])
"""
s = np.asarray(a).shape
if s is ():
if == is ():
return 1 if b else (1,)*nargout
# a is not a scalar
try:
Expand All @@ -665,7 +665,7 @@ def size_equal(a,b):
return True

from numpy import sqrt
sort = __builtin__.sorted
sort = builtins.sorted

def strcmp(a,b):
return str(a) == str(b)
Expand Down