Skip to content

Replace imp#260

Open
dirks wants to merge 4 commits intofboender:masterfrom
dirks:replace-imp
Open

Replace imp#260
dirks wants to merge 4 commits intofboender:masterfrom
dirks:replace-imp

Conversation

@dirks
Copy link
Copy Markdown

@dirks dirks commented May 15, 2024

gardar and others added 4 commits October 24, 2023 15:06
Signed-off-by: gardar <gardar@users.noreply.github.com>
Signed-off-by: gardar <gardar@users.noreply.github.com>
imp is removed in python 3.12
@dirks
Copy link
Copy Markdown
Author

dirks commented May 15, 2024

fixes #259

tpl_dir = os.path.join(data_dir, 'tpl')
static_dir = os.path.join(data_dir, 'static')
version = open(os.path.join(data_dir, 'VERSION')).read().strip()
version = version("ansible-cmdb")
Copy link
Copy Markdown

@mgedmin mgedmin Sep 10, 2024

Choose a reason for hiding this comment

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

This doesn't work:

UnboundLocalError: cannot access local variable 'version' where it is not associated with a value

You need to give different names to the imported global function and the local variable.

This works: mgedmin@53b5c30

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.

3 participants