Put your lines into a_finder.py:
if OldVersion:
from my.package.location.A import A
else:
from new.package.location.A import A
Then in your product code:
from a_finder import A
and you will get the proper A.
More Related Contents:
- Does Python IDE have a module which imports math functions such as cos or sin? [closed]
- Relative imports for the billionth time
- Call a function from another file?
- `from … import` vs `import .` [duplicate]
- Importing from builtin library when module with same name exists
- Pandas/Python: Set value of one column based on value in another column
- Python: importing a sub‑package or sub‑module
- Can’t import my own modules in Python
- How to import all submodules?
- Import Error: No module named numpy
- Why do circular imports seemingly work further up in the call stack but then raise an ImportError further down?
- What could cause a python module to be imported twice?
- Namespaces with Module Imports
- How to reload a module’s function in Python?
- ImportError on python 3, worked fine on python 2.7
- Importing classes from different files in a subdirectory
- Python import precedence: packages or modules?
- Python importing a module from a parallel directory
- Detecting Vowels vs Consonants In Python [duplicate]
- from … import OR import … as for modules
- ModuleNotFoundError: No module named ‘…’
- Import Python Script Into Another?
- Importing a function from a class in another file? [duplicate]
- How do I override a Python import?
- import a function from another .ipynb file
- Simple cross import in python
- using variable in import command
- python import module from parent package
- How to reference python package when filename contains a period
- How do I import a Python script from a sibling directory?