Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Invalid syntax #89

Closed
Closed
@42B

Description

@42B

Issue Summary

Even the syntax highlighting here on GitHub (in red) shows this to be invalid syntax. Simply changing || to or should solve this problem. One other consideration could be to use self.assertTrue(...) instead of self.assertEqual(True, ...) for the other tests in this file.

@mbernier -> b26031b

self.assertEqual(True, os.path.isdir("./Dockerfile") || os.path.isdir("./docker/Dockerfile"))

self.assertEqual(True, os.path.isfile('./docker-compose.yml') || os.path.isfile('./docker/docker-compose.yml'))

self.assertEqual(True, os.path.isfile('./LICENSE.md') || os.path.isfile('./LICENSE.txt'))

Steps to Reproduce

$ python2
Python 2.7.15rc1 (default, Apr 15 2018, 21:51:34) 
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.path.isdir("./Dockerfile") || os.path.isdir("./docker/Dockerfile")
  File "<stdin>", line 1
    os.path.isdir("./Dockerfile") || os.path.isdir("./docker/Dockerfile")
                                   ^
SyntaxError: invalid syntax

$ python
Python 3.7.1 (default, Oct 20 2018, 18:18:46) 
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> os.path.isdir("./Dockerfile") || os.path.isdir("./docker/Dockerfile")
  File "<stdin>", line 1
    os.path.isdir("./Dockerfile") || os.path.isdir("./docker/Dockerfile")
                                   ^
SyntaxError: invalid syntax

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions