Skip to content

Many examples won't work if config file is not specified in Python 3.9+ #374

@shixnya

Description

@shixnya

Many examples under examples/ use the following line to set the 'default' config file.

if __file__ != sys.argv[-1]:

However, in Python 3.9+, this won't work because __file__ is an absolute path.

An easy way to fix it will be using something like:

if sys.argv[-1] in __file__:

Or, alternatively, we can change __file__ to os.path.basename(__file__).

There might be a better idea, so making an issue to discuss.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions