Skip to content
Merged
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
7 changes: 4 additions & 3 deletions mypyc/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,14 @@ def get_extension() -> type[Extension]:
# We can work with either setuptools or distutils, and pick setuptools
# if it has been imported.
use_setuptools = "setuptools" in sys.modules
extension_class: type[Extension]

if not use_setuptools:
from distutils.core import Extension
from distutils.core import Extension as extension_class
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
from distutils.core import Extension as extension_class
import distutils.core
extension_class = distutils.core.Extension

Just a hunch

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying it out now...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And it worked!

else:
from setuptools import Extension
from setuptools import Extension as extension_class

return Extension
return extension_class


def setup_mypycify_vars() -> None:
Expand Down