-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 issue #2985 #3214
fixed issue #2985 #3214
Conversation
updating my forked repo
@surajkumar-sk Thanks a lot, these changes worked for me. |
@sradhanjan . I'm glad it worked . 🙂 |
build/compiler.py
Outdated
if os.name == 'nt' : | ||
self.config_path = self.config_path.replace('\\','/') | ||
for j in range(0,len(self.source_files)): | ||
self.source_files[j] = self.source_files[j].replace('\\','/') |
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.
A more Python way to do this would be:
self.source_files = [f.replace('\\', '/') for f in self.source_files]
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.
That's a cool way . Concating for loop and statement into a single line . Now I'll always use that from now . Just a follow up , can we add more than one line of code in that format .
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.
I'm not sure what you mean. This is called list-comprehension. This is just assigning to a new array it just created. The basic format is [val for f in list]
where val
can be any expression and is each element's value and list
is the source list.
build/compiler.py
Outdated
@@ -357,6 +357,12 @@ def lint(self, fix=False, force=False): | |||
deps = self.source_files + [self.config_path] | |||
if not force and not _must_build(self.output, deps): | |||
return True | |||
"""Windows shows an error when the file location has '\\' so for |
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.
I just noticed this isn't the function docstring. This should just be a comment. Also you don't need to explain what the code is doing, just why it is. So this would be better.
# Windows shows an error when the file location has '\\'.
build/compiler.py
Outdated
"""Windows shows an error when the file location has '\\' so for | ||
windows the below if condition changes the'\\' with '/' | ||
in variable storing file locations """ | ||
if sys.platform == 'win32' : |
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.
Remove extra space before :
.
build/compiler.py
Outdated
windows the below if condition changes the'\\' with '/' | ||
in variable storing file locations """ | ||
if sys.platform == 'win32' : | ||
self.config_path = self.config_path.replace('\\','/') |
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.
Add space between arguments.
Test Failure:
|
Your code has a bunch of zero-width spaces in it (U+200B). Make sure your editor isn't adding these. |
@TheModMaker Actually, I copy-pasted that if condition line which caused an encoding error. I removed that and retyped the condition. It should work on. |
@TheModMaker Thank you for being so patient. I'll make sure to check for all the above mistakes in my next commit. |
All tests passed! |
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
issue #2985 occurs in windows . replacing '\' with '/' fixes the error for windows but impling the changes to all platforms may result in errors so an if condition is added to replace slashes only in windows .
there was a ';' inside check.py which i believe was a syntax error so removed it .
Fixes # (issue)
#2985
Screenshots (optional)
Type of change
Checklist:
My code follows the style guidelines of this project
I have performed a self-review of my own code
My changes generate no new warnings
New and existing unit tests pass locally with my changes