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

clean up #43

Merged
merged 2 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion httpout/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright (c) 2024 nggit

__version__ = '0.0.45'
__version__ = '0.0.46'
__all__ = ('HTTPOut',)

from .httpout import HTTPOut # noqa: E402
8 changes: 4 additions & 4 deletions httpout/httpout.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ def ho_import(name, globals=None, locals=None, fromlist=(), level=0):

if (globals['__name__'] == '__globals__' or
child not in module.__server__):
try:
module.__dict__[child] = worker[child]
except KeyError as exc:
if child not in worker:
raise ImportError(
f'cannot import name \'{child}\' '
f'from \'{name}\''
) from exc
)

module.__dict__[child] = worker[child]
else:
module.__dict__[child] = module.__server__[
child
Expand Down
2 changes: 1 addition & 1 deletion httpout/utils/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
def exec_module(module, code=None, max_size=8 * 1048576):
if code is None:
if os.stat(module.__file__).st_size > max_size:
raise OSError(f'File {module.__file__} exceeds the max_size')
raise ValueError(f'File {module.__file__} exceeds the max_size')

with open(module.__file__, 'r') as f:
code = compile(f.read(), '<string>', 'exec')
Expand Down
3 changes: 1 addition & 2 deletions httpout/utils/modules.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ def exec_module(module, code=None, size_t max_size=8 * 1048576):

if file_size > max_size:
fclose(fp)
raise OSError(f'File {module.__file__} exceeds the max_size')
raise ValueError(f'File {module.__file__} exceeds the max_size')

fseek(fp, 0, SEEK_SET)

data = bytearray()

while True:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ description = """\
requires-python = '>=3.7'
dependencies = [
'awaiter',
'tremolo>=0.0.760',
'tremolo>=0.0.761',
]
license = { text = 'MIT License' }
classifiers = [
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
awaiter
tremolo>=0.0.760
tremolo>=0.0.761
Loading