summaryrefslogtreecommitdiff
path: root/torch/multiprocessing
diff options
context:
space:
mode:
authorpeterjc123 <peter_jiachen@163.com>2017-12-20 22:07:25 +0800
committerAdam Paszke <adam.paszke@gmail.com>2017-12-20 15:07:25 +0100
commit77ea2f26d8a83a3a18c2f412b5c16f732b07fb52 (patch)
tree6dfed386a29dbe63471aa141a7a697c47e64bc6d /torch/multiprocessing
parentb11db95478613347d4a0837f89c1b9e5c6dc05e6 (diff)
downloadpytorch-77ea2f26d8a83a3a18c2f412b5c16f732b07fb52.tar.gz
pytorch-77ea2f26d8a83a3a18c2f412b5c16f732b07fb52.tar.bz2
pytorch-77ea2f26d8a83a3a18c2f412b5c16f732b07fb52.zip
Add build support for Python 2.7 using MSVC (#4226)
Diffstat (limited to 'torch/multiprocessing')
-rw-r--r--torch/multiprocessing/queue.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/torch/multiprocessing/queue.py b/torch/multiprocessing/queue.py
index ad0a32b08b..9696ee4206 100644
--- a/torch/multiprocessing/queue.py
+++ b/torch/multiprocessing/queue.py
@@ -22,7 +22,10 @@ class ConnectionWrapper(object):
return pickle.loads(buf)
def __getattr__(self, name):
- return getattr(self.conn, name)
+ if 'conn' in self.__dict__:
+ return getattr(self.conn, name)
+ raise AttributeError("'{}' object has no attribute '{}'".format(
+ type(self).__name__, 'conn'))
class Queue(multiprocessing.queues.Queue):