Use time.strptime instead of datetime.strptime
Embedding the Python interpreter multiple times in the same process can cause this issue due to import caching. https://bugs.python.org/issue27400 This seems to be avoidable by using the time module instead.
This commit is contained in:
@ -15,7 +15,7 @@ from .pylammps import *
|
||||
|
||||
# convert module string version to numeric version
|
||||
def get_version_number():
|
||||
from datetime import datetime
|
||||
import time
|
||||
from sys import version_info
|
||||
vstring = None
|
||||
if version_info.major == 3 and version_info.minor >= 8:
|
||||
@ -32,7 +32,7 @@ def get_version_number():
|
||||
if not vstring:
|
||||
return 0
|
||||
|
||||
d = datetime.strptime(vstring, "%d%b%Y")
|
||||
return d.year*10000 + d.month*100 + d.day
|
||||
t = time.strptime(vstring, "%d%b%Y")
|
||||
return t.tm_year*10000 + t.tm_mon*100 + t.tm_mday
|
||||
|
||||
__version__ = get_version_number()
|
||||
|
||||
Reference in New Issue
Block a user