Skip to content

Conversation

@Ferenc-
Copy link
Member

@Ferenc- Ferenc- commented Jun 12, 2024

If the gevent module is not installed,
but there is a directory called gevent
or a gevent.py file in the current directory,
then that is already importable and the statment
if sys.modules['gevent'].version_info < (1, 4):
fails with
AttributeError: module 'gevent' has no attribute 'version_info'

This can happen easily since many libraries like celery, grpc, opentracing etc, deliver their own file called gevent.py.

@Ferenc- Ferenc- requested review from GSVarsha and pvital June 12, 2024 08:15
Copy link
Contributor

@GSVarsha GSVarsha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

If the `gevent` module is not installed,
but there is a directory called `gevent`
or a `gevent.py` file in the current directory,
then that is already importable and the statment
`if sys.modules['gevent'].version_info < (1, 4):`
fails with
`AttributeError: module 'gevent' has no attribute 'version_info'`

This can happen easily since many libraries like `celery`, `grpc`, `opentracing` etc,
deliver their own file called `gevent.py`.

Signed-off-by: Ferenc Géczi <ferenc.geczi@ibm.com>
Copy link
Member

@pvital pvital left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me.

@Ferenc- Ferenc- merged commit 9006c03 into master Jun 12, 2024
@Ferenc- Ferenc- deleted the fix-gevent-crash branch June 12, 2024 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants