Skip to content

bug: Check for relative import before looking up context.filename#15

Draft
vivster7 wants to merge 1 commit intomainfrom
bug--Check-for-relative-import-before-looking-up-context.filename
Draft

bug: Check for relative import before looking up context.filename#15
vivster7 wants to merge 1 commit intomainfrom
bug--Check-for-relative-import-before-looking-up-context.filename

Conversation

@vivster7
Copy link
Contributor

If a --format argument is passed to ReplaceImport, we try and represent it as an Import object.

At this point, we won't have a context.filename and will raise an error when trying to normalize a relative import. We don't need to worry about relative imports for imports being passed as --format.

This PR moves the relative import check up first so it'll early exit and skip the context.filename lookup.

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.

1 participant