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

Fixed relative import for require and added tests #2015

Merged

Conversation

peaceamongworlds
Copy link
Contributor

Fixes #1897.

I started with of with @jams2's patch, but that didn't allow for multiple "." in the source module. This should work with any valid relative path.

@Kodiologist
Copy link
Member

Won't this produce weird error messages if source_dirs or target_dirs isn't long enough?

@peaceamongworlds peaceamongworlds force-pushed the fix_relative_paths_require branch from 6d4f714 to 678e431 Compare March 23, 2021 19:10
@peaceamongworlds
Copy link
Contributor Author

Won't this produce weird error messages if source_dirs or target_dirs isn't long enough?

Good point. Now if target_dirs isn't long enough you'll get an attempted relative import beyond top-level package message.

@Kodiologist
Copy link
Member

Cool, but I think you left in a debugging statement.

@peaceamongworlds peaceamongworlds force-pushed the fix_relative_paths_require branch 2 times, most recently from e74ad75 to 0908ab7 Compare March 23, 2021 19:21
@peaceamongworlds
Copy link
Contributor Author

Cool, but I think you left in a debugging statement.

Fixed

@Kodiologist Kodiologist force-pushed the fix_relative_paths_require branch from 0908ab7 to 6f01d05 Compare March 27, 2021 13:45
@Kodiologist Kodiologist merged commit 02559d0 into hylang:master Mar 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

require with relative path crashes the compiler
2 participants