Skip to content

Support running with CPython interpreter's -OO flag #415

Description

@jcharlong

My application runs fine with CPython when not supplying any optimization flags and with the -O flag, but fails when -OO is supplied. -OO removes docstrings, & the following error occurs in my application when using -OO:

  File "/var/volatile/tmp/.mount_hl1001bZZXj5/usr/lib/python3/dist-packages/fs/opener/registry.py", line 216, in open_fs
    from ..base import FS
  File "/var/volatile/tmp/.mount_hl1001bZZXj5/usr/lib/python3/dist-packages/fs/base.py", line 94, in <module>
    class FS(object):
  File "/var/volatile/tmp/.mount_hl1001bZZXj5/usr/lib/python3/dist-packages/fs/base.py", line 607, in FS
    getbytes = _new_name(readbytes, "getbytes")
  File "/var/volatile/tmp/.mount_hl1001bZZXj5/usr/lib/python3/dist-packages/fs/base.py", line 88, in _new_name
    _method.__doc__ += deprecated_msg
TypeError: unsupported operand type(s) for +=: 'NoneType' and 'str'

Created a simple PR which fixes the issue for my application in #414 .

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions