mirror of
https://github.com/dh1tw/pyhamtools.git
synced 2025-12-06 06:52:00 +01:00
- finally using libxml2 parser in beautifulsoup/lxml - minor bug in parsing the CCC field (qrz.com) - fixed VK9XX fixture (lat/long) - added support for python 3.10 and 3.11, pypy3.7-3.9 - removed support for python 3.4 - fixed escapings in regular expressions - replaced exefile from past.buildins with custom function
17 lines
803 B
Python
17 lines
803 B
Python
# In Python3 the function 'execfile' has been deprecated. The alternative is 'exec'.
|
|
# While the package 'past.builtins' provide a python2 / python3 compatible version of 'execfile',
|
|
# the import of 'past.builtins' keeps on throwing a deprecation warning about 'imp'.
|
|
# Therefore the version of 'execfile' from 'past/builtins' has been replaced by this alternative
|
|
# version, found on: https://stackoverflow.com/a/41658338/2292376
|
|
|
|
# When support of Python2 is finally dropped, this function can be removed
|
|
|
|
def execfile(filepath, globals=None, locals=None):
|
|
if globals is None:
|
|
globals = {}
|
|
globals.update({
|
|
"__file__": filepath,
|
|
"__name__": "__main__",
|
|
})
|
|
with open(filepath, 'rb') as file:
|
|
exec(compile(file.read(), filepath, 'exec'), globals, locals) |