GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||
GeezerVison is showing github.com — gh-143959: Make _datetime optional for test_sys by youknowone · Pull Request #144003 · python/cpython Conversation
|
| self.assertEqual(sys.getsizeof(True, -1), size('') + self.longdigit) | ||
|
|
||
| def test_objecttypes(self): | ||
| import _datetime |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I suggest to import it just before it is used, like collections.
And since it is optional, skip the corresponding test if the import fails.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Fixed it
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
And since it is optional, skip the corresponding test if the import fails.
_datetime is now a built-in module, it's not really optional.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Isn't it just an implementation detail? It was made builtin to solve a particular technical issue which can be solved in other way.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| check(x, size('5Pi')) | ||
| # PyCapsule | ||
| import _datetime | ||
| check(_datetime.datetime_CAPI, size('6P')) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
As @serhiy-storchaka requested, this line should only be run if _datetime is available. Something like:
try: import _datetime except ImportError: pass else: check(_datetime.datetime_CAPI, size('6P'))
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Thanks @youknowone for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
(cherry picked from commit c447d1b) Co-authored-by: Jeong, YunWon <[email protected]>
(cherry picked from commit c447d1b) Co-authored-by: Jeong, YunWon <[email protected]>
|
GH-144143 is a backport of this pull request to the 3.14 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-144144 is a backport of this pull request to the 3.13 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.