Skip to content

Commit

Permalink
fix posix systems imports
Browse files Browse the repository at this point in the history
  • Loading branch information
doronz88 committed Apr 10, 2024
1 parent c00537e commit e9ef4c4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion darwin_pytun.c
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ static struct PyModuleDef pytun_module =
#endif

#if PY_MAJOR_VERSION >= 3
PyMODINIT_FUNC PyInit_pytun_pmd3(void)
PyMODINIT_FUNC PyInit_pytun_pmd3_c(void)
#else
PyMODINIT_FUNC initpytun(void)
#endif
Expand Down
2 changes: 1 addition & 1 deletion linux_pytun.c
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,7 @@ static struct PyModuleDef pytun_module =
#endif

#if PY_MAJOR_VERSION >= 3
PyMODINIT_FUNC PyInit_pytun_pmd3(void)
PyMODINIT_FUNC PyInit_pytun_pmd3_c(void)
#else
PyMODINIT_FUNC initpytun(void)
#endif
Expand Down
2 changes: 2 additions & 0 deletions pytun_pmd3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@

if sys.platform == 'win32':
from pytun_pmd3.wintun import TunTapDevice
else:
from pytun_pmd3_c import TunTapDevice
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
sources = ['linux_pytun.c']

setup(name='pytun-pmd3', ext_modules=[
Extension('pytun_pmd3', sources, include_dirs=[Path(__file__).parent])],
Extension('pytun_pmd3_c', sources, include_dirs=[Path(__file__).parent])],
extra_compile_args=["-Wall", "-Wextra", "-pedantic"])
else:
# windows
Expand Down

0 comments on commit e9ef4c4

Please sign in to comment.