forked from behave/behave
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIX for OS=Windows: Rename __main__.py => main.py, causes problems w/…
… script on windows.
- Loading branch information
Showing
3 changed files
with
4 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ _build | |
.ropeproject | ||
tools/virtualenvs | ||
build.log | ||
.idea/* |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#!/usr/bin/env python | ||
|
||
from behave.__main__ import main | ||
from behave.main import main | ||
|
||
main() | ||
if __name__ == "__main__": | ||
main() |
c8575a5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you be more specific about what this fixes?
The
__main__.py
idiom is a documented thing for Python (see http://docs.python.org/release/2.7.3/using/cmdline.html) and if it's not working on Windows I'd like to see if there's another way to fix it.c8575a5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are several issues using behave on Windows.
After installation, the "behave" script does not work, because it is only made for UNIX-like system
and not converted during installation.
Because Windows does not honor Shebang, the script cannot be executed.
When I manually fixed it by providing a behave.py and behave.cmd script,
I ran into a problem with using "main" to import the main() function.
After I renamed it to "main.py", it did not longer run into this problem again.
I didn't investigate it further.
ADDITIONAL PROBLEMS on Windows:
This results in better platform-independence.