Skip to content

fixed bug, not being able to write code on the first line#10

Merged
jaykv merged 1 commit intojaykv:mainfrom
KianBahasadri:main
Feb 19, 2024
Merged

fixed bug, not being able to write code on the first line#10
jaykv merged 1 commit intojaykv:mainfrom
KianBahasadri:main

Conversation

@KianBahasadri
Copy link
Contributor

Hello, first of all this is my first pull request. (Sorry if I dont really know what I'm doing)
Second of all, pybash currently gets a syntax error anytime it parses a file that has code on the first line, this is because of this line in import_hook.py:

180         if self.source_init is not None:
181             source = self.source_init() + source

Its basically doing "import subprocess" + source, which concatenates the import line and the first line of the code.
I changed it to "import subprocess\n" so that the import stays on its own line.

p.s. your project is really cool, thanks for making it :)

@jaykv
Copy link
Owner

jaykv commented Feb 19, 2024

Thanks for fixing this! I'll get this out in a new version.

Glad you like the project :)

@jaykv jaykv merged commit 79491bf into jaykv:main Feb 19, 2024
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.

2 participants