Set modification time of targetpath according to tarinfo.
(self, tarinfo, targetpath)
| 2567 | raise ExtractError("could not change mode") from e |
| 2568 | |
| 2569 | def utime(self, tarinfo, targetpath): |
| 2570 | """Set modification time of targetpath according to tarinfo. |
| 2571 | """ |
| 2572 | mtime = tarinfo.mtime |
| 2573 | if mtime is None: |
| 2574 | return |
| 2575 | if not hasattr(os, 'utime'): |
| 2576 | return |
| 2577 | try: |
| 2578 | os.utime(targetpath, (mtime, mtime)) |
| 2579 | except OSError as e: |
| 2580 | raise ExtractError("could not change modification time") from e |
| 2581 | |
| 2582 | #-------------------------------------------------------------------------- |
| 2583 | def next(self): |
no test coverage detected