[webkit-reviews] review granted: [Bug 215712] [webkitcorepy] Standard Popen mocking API : [Attachment 407245] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Aug 25 16:55:17 PDT 2020


dewei_zhu at apple.com has granted Jonathan Bedard <jbedard at apple.com>'s request
for review:
Bug 215712: [webkitcorepy] Standard Popen mocking API
https://bugs.webkit.org/show_bug.cgi?id=215712

Attachment 407245: Patch

https://bugs.webkit.org/attachment.cgi?id=407245&action=review




--- Comment #6 from dewei_zhu at apple.com ---
Comment on attachment 407245
  --> https://bugs.webkit.org/attachment.cgi?id=407245
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=407245&action=review

> Tools/Scripts/libraries/webkitcorepy/webkitcorepy/mocks/popen.py:43
> +    if sys.version_info > (3, 0):

I still see a lot of things in common in the implementation of __init__,
communicate and etc.
Wouldn't it be much clearer if we have a base class?
```
class PopenBase(object):
      def __init__
...

if sys.version_info > (3, 0):
    class Popen(PopenBase):
	def __init__
	def __enter__
	def __exit__
	...
else:
    class Popen(PopenBase):
	...
```


More information about the webkit-reviews mailing list