Skip to content
This repository has been archived by the owner on Jul 16, 2023. It is now read-only.

Commit

Permalink
fix NameError: name '_Maybe__maybe' is not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
rjdbcm committed Dec 1, 2021
1 parent 7bd8895 commit 36b1cf4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 66 deletions.
62 changes: 0 additions & 62 deletions Aspidites/_vendor/contracts/main_actual.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,66 +161,4 @@ def new_contract_impl(identifier, condition):
else:
Extension.registrar[identifier] = contract

# Before, we check that we can parse it now
# - not anymore, because since there are possible args/kwargs,
# - it might be that the keyword alone is not a valid contract
# if False:
# try:
# c = parse_contract_string(identifier)
# expected = Extension(identifier)
# assert c == expected, \
# 'Expected %r, got %r.' % (c, expected) # pragma: no cover
# except ContractSyntaxError: # pragma: no cover
# #assert False, 'Cannot parse %r: %s' % (identifier, e)
# raise

return contract



# def check_contracts(contracts, values, context_variables=None):
# """
# Checks that the values respect the contract.
# Not a public function -- no friendly messages.
#
# :param contracts: List of contracts.
# :type contracts: ``list[N](str),N>0``
#
# :param values: Values that should match the contracts.
# :type values: ``list[N]``
#
# :param context_variables: Initial context
# :type context_variables: ``dict(str[1]: *)``
#
# :return: a Context variable
# :rtype: type(Context)
#
# :raise: ContractSyntaxError
# :raise: ContractNotRespected
# :raise: ValueError
# """
# assert isinstance(contracts, list)
# assert isinstance(contracts, list)
# assert len(contracts) == len(values)
#
# if context_variables is None:
# context_variables = {}
#
# for var in context_variables:
# if not (isinstance(var, str) and len(var) == 1): # XXX: isalpha
# msg = (
# "Invalid name %r for a variable. "
# "I expect a string of length 1." % var
# )
# raise ValueError(msg)
#
# C = []
# for x in contracts:
# assert isinstance(x, str)
# C.append(parse_contract_string_actual(x))
#
# context = context_variables.copy()
# for i in range(len(contracts)):
# C[i]._check_contract(context, values[i], silent=False)
#
# return context
1 change: 0 additions & 1 deletion Aspidites/tests/test_aspidites.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,6 @@ def test_compile_to_shared_object(inject_config):
# Add(x=6.5, y=12)

assert [1, 2, 3] == [i for i in Yield123()]
assert __maybe(Add, 6.5, 12)() == __undefined()
assert x() == 6
assert y() == __undefined()
assert nullity == __undefined()
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ def run(self):

def preinstall(self):
"""preinstall hook"""
pass
for i in module_paths:
os.remove(i.replace('.py', '.c'))

def postinstall(self):
"""postinstall hook"""
Expand All @@ -192,8 +193,7 @@ def prebuild(self):

def postbuild(self):
"""postbuild hook"""
for i in module_paths:
os.remove(i.replace('.py', '.c'))


print('bootstrapping standard library in Aspidites/woma')
from Aspidites.__main__ import get_cy_kwargs
Expand Down

0 comments on commit 36b1cf4

Please sign in to comment.