All supported versions of Python define __package__.

https://www.python.org/dev/peps/pep-0366/ lists Python 2.6 and 3.0 as
the minimum requirements for this attribute. sys.__dict__ contains it.
This commit is contained in:
Mads Jensen 2022-02-01 10:25:21 +01:00 committed by Asif Saif Uddin
parent 2f3b153acc
commit f1317aa8c1
1 changed files with 1 additions and 7 deletions

View File

@ -86,12 +86,6 @@ class module(ModuleType):
return result
# 2.5 does not define __package__
try:
package = __package__
except NameError: # pragma: no cover
package = 'kombu'
# keep a reference to this module so that it's not garbage collected
old_module = sys.modules[__name__]
@ -106,7 +100,7 @@ new_module.__dict__.update({
'__contact__': __contact__,
'__homepage__': __homepage__,
'__docformat__': __docformat__,
'__package__': package,
'__package__': __package__,
'version_info_t': version_info_t,
'version_info': version_info,
'VERSION': VERSION