1# -*- coding: utf-8 -*- 2# Copyright 2017 The Chromium OS Authors. All rights reserved. 3# Use of this source code is governed by a BSD-style license that can be 4# found in the LICENSE file. 5 6from __future__ import print_function 7 8import sys 9 10 11# This is to work around a Python bug: The first call to 12# datetime.datetime.strptime() within the Python VM can fail if it 13# happens in a multi-threaded context. To work around that, we force a 14# "safe" call here. For more details, see: 15# https://bugs.python.org/issue7980 16# https://crbug.com/710182 17if sys.version_info.major < 3: 18 import datetime 19 datetime.datetime.strptime(datetime.datetime.now().strftime('%Y'), '%Y') 20