Removed redundant casts to `char *`.
Corresponding functions now accept `const char *` (issue #1772673).
Removed a code for suport Python version <2.2.
#10510: Fix bug in forward port of 2.7 distutils patch.

Pointed out by Arfrever.

--HG--
branch : 3.4
#10510: Fix bug in forward port of 2.7 distutils patch.

Pointed out by Arfrever.
check that exception messages are not empty (#22379)

Patch by Yongzhi Pan.

--HG--
branch : 3.4
extra : amend_source : e2e37e084880a987d174fa8e565ab8e6bd41ad17
merge 3.4 (#22379)
Closes issue #20858: Enhancements/fixes to pure-python datetime module

This patch brings the pure-python datetime more in-line with the C
module.  Patch contributed by Brian Kearns, a PyPy developer.  PyPy
project has been running these modifications in PyPy2 stdlib.

This commit includes:

- General PEP8/cleanups;
- Better testing of argument types passed to constructors;
- Removal of duplicate operations;
- Optimization of timedelta creation;
- Caching the result of __hash__ like the C accelerator;
- Enhancements/bug fixes in tests.